{
  "openapi": "3.0.3",
  "info": {
    "title": "DreamTechGames Provider API",
    "version": "2.0.5",
    "description": "Contrato de provedor para abertura de jogos, catalogo, agente, rodadas gratis e callbacks financeiros. O agente autentica o white label e recebe callbacks; o credito comercial pertence exclusivamente a carteira do proprietario.\nSegurança: callbacks do operador exigem HTTPS/443, certificado válido e DNS exclusivamente público, sem redirecionamentos. Credenciais são exclusivas do backend e devem pertencer ao mesmo agente. Trate HTTP 429 com espera; callbacks financeiros exigem idempotência persistente.\nConsulta dtg-reconciliation-v1 — requisito para novas integrações: consulta assinada no endpoint do OPERADOR, habilitada por agente. Clientes existentes permanecem compatíveis. Consulte x-dtg-operator-reconciliation e /developer.\nRevisão documental 2026-10-19: envelopes por integração, estados por fila, contagem de rodadas e conciliação. Nenhum endpoint ou campo obrigatório do cliente atual foi alterado. Recuperacao interna por comprovante nao altera o contrato de callback. Consulta externa por ID e obrigatoria para novas homologacoes e deve ser respondida pelo servidor do operador, em URL ou metodo explicitamente homologado; uma consulta hospedada pela DreamTech nao comprova a carteira externa.\nRevisão documental 20/10/2026: novas integrações devem homologar consulta por ID, comprovante durável e idempotência. Contratos existentes permanecem válidos e podem adotar as funções novas após homologação específica; esta revisão documental não ativa consultas nem altera callbacks existentes."
  },
  "servers": [
    {
      "url": "https://dreamtechgames.fun"
    }
  ],
  "paths": {
    "/api/v2/game_launch": {
      "post": {
        "summary": "Abrir jogo",
        "description": "Abre jogo ativo do catálogo. Use game_code e provider da mesma entrada, consulte wallet_type e GET /api/v2/balances. Distribuição técnica e original não determinam a carteira comercial. Preserve user_code e abra exatamente launch_url; credenciais ficam no backend.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameLaunchRequest"
              },
              "example": {
                "secretKey": "SEU_AGENT_SECRET",
                "agentToken": "SEU_AGENT_TOKEN",
                "user_code": "123",
                "user_balance": 100.5,
                "game_code": "fortune-tiger-dreamtechgames",
                "provider": "DREAMTECHGAMES",
                "lang": "pt",
                "game_original": false,
                "user_rtp": 96
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Jogo aberto",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameLaunchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Falha no provedor"
          },
          "403": {
            "description": "Credenciais, saldo ou jogo invalido"
          },
          "409": {
            "description": "Carteira nao configurada ou estado financeiro que exige reconciliacao"
          },
          "422": {
            "description": "Payload invalido"
          }
        }
      }
    },
    "/api/v2/providers": {
      "get": {
        "summary": "Listar provedores",
        "responses": {
          "200": {
            "description": "Lista de provedores",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/games": {
      "get": {
        "summary": "Listar jogos ativos DreamTechGames e PlayFiver",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Página a partir de 1. Ao informar page ou per_page, a resposta inclui meta.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Itens por página; máximo 500. Ao informar page ou per_page, a resposta inclui meta.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de jogos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameListResponse"
                }
              }
            }
          },
          "404": {
            "description": "Provedor desconhecido"
          },
          "422": {
            "description": "Paginação inválida"
          }
        }
      }
    },
    "/api/v2/balances": {
      "get": {
        "summary": "Consultar saldos comerciais da carteira do operador",
        "parameters": [
          {
            "name": "agentToken",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secretKey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Saldos comerciais da carteira proprietária do agente autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "data"
                  ],
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 1
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "number",
                        "format": "float"
                      },
                      "example": {
                        "Carteira Principal": 0,
                        "Carteira DreamTechPremium": 0,
                        "Jogos Ao Vivo": 0
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Credenciais inválidas ou ausentes"
          }
        }
      }
    },
    "/api/v2/agent": {
      "get": {
        "summary": "Consultar configuracao do agente",
        "parameters": [
          {
            "name": "agentToken",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secretKey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Configuracao do agente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentConfigResponse"
                }
              }
            }
          },
          "422": {
            "description": "Credenciais inválidas ou ausentes"
          }
        }
      },
      "put": {
        "summary": "Atualizar configuracao do agente",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentConfigUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Configuracao atualizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentConfigResponse"
                }
              }
            }
          },
          "422": {
            "description": "Credenciais ou configuração inválidas"
          }
        }
      }
    },
    "/api/v2/free_bonus": {
      "get": {
        "summary": "Listar rodadas gratis",
        "parameters": [
          {
            "name": "agentToken",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secretKey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "description": "Retorna o andamento de uma campanha geral pertencente ao agente autenticado.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de rodadas gratis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeBonusListResponse"
                }
              }
            }
          },
          "404": {
            "description": "Campanha não encontrada para o agente"
          },
          "422": {
            "description": "Credenciais ou campanha inválidas"
          }
        }
      },
      "post": {
        "summary": "Agendar rodadas gratis individualmente ou em campanha geral",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FreeBonusCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rodadas gratis individuais agendadas"
          },
          "202": {
            "description": "Campanha geral registrada para processamento em fila"
          },
          "423": {
            "description": "Operação de rodadas grátis bloqueada até habilitação administrativa"
          },
          "404": {
            "description": "Jogo sem suporte a rodadas grátis"
          },
          "422": {
            "description": "Payload ou credenciais inválidos"
          }
        }
      },
      "delete": {
        "summary": "Remover rodadas gratis",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FreeBonusDeleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rodadas gratis removidas"
          },
          "404": {
            "description": "Concessão não encontrada para o agente"
          },
          "422": {
            "description": "Credenciais ou identificador inválidos"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GameLaunchRequest": {
        "type": "object",
        "required": [
          "secretKey",
          "agentToken",
          "user_code",
          "user_balance",
          "game_code",
          "provider"
        ],
        "properties": {
          "secretKey": {
            "type": "string"
          },
          "agentToken": {
            "type": "string"
          },
          "user_code": {
            "type": "string"
          },
          "user_balance": {
            "type": "number",
            "format": "float"
          },
          "game_code": {
            "type": "string",
            "description": "Copie da mesma entrada atual retornada por GET /api/v2/games."
          },
          "provider": {
            "type": "string",
            "description": "Copie provider.name da mesma entrada de catálogo usada no game_code."
          },
          "lang": {
            "type": "string",
            "default": "pt",
            "description": "Opcional nesta borda por compatibilidade; em apiplayfiver é enviado ao upstream PlayFiver, onde é obrigatório."
          },
          "game_original": {
            "type": "boolean",
            "description": "Opcional nesta borda; quando ausente, é resolvido pelo catálogo. Em apiplayfiver é enviado ao upstream PlayFiver, onde é obrigatório."
          },
          "user_rtp": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          }
        }
      },
      "GameLaunchResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 1
          },
          "msg": {
            "type": "string",
            "example": "SUCCESS"
          },
          "launch_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ProviderListResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 1
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "status": {
                  "type": "boolean"
                },
                "type": {
                  "type": "string",
                  "example": "live",
                  "description": "Opcional: live nas provedoras do catálogo Ao Vivo."
                },
                "wallet_catalog": {
                  "type": "string",
                  "example": "live",
                  "description": "Opcional nas provedoras Ao Vivo."
                },
                "wallet_type": {
                  "type": "string",
                  "example": "balance_playfiverPremium",
                  "description": "Opcional nas provedoras Ao Vivo; nome legado preservado."
                }
              }
            }
          }
        }
      },
      "GameListResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 1
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameCatalogItem"
            }
          },
          "meta": {
            "type": "object",
            "description": "Presente somente quando page ou per_page é informado.",
            "required": [
              "page",
              "per_page",
              "total",
              "last_page"
            ],
            "properties": {
              "page": {
                "type": "integer",
                "minimum": 1
              },
              "per_page": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500
              },
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "last_page": {
                "type": "integer",
                "minimum": 1
              }
            }
          }
        }
      },
      "GameCatalogItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Identificador público estável do catálogo. Campo opcional, presente somente em títulos específicos."
          },
          "name": {
            "type": "string"
          },
          "game_code": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "Campo opcional, presente somente em títulos específicos."
          },
          "launch_slug": {
            "type": "string",
            "description": "Slug composto por provider e game_code para o launch. Campo opcional, presente somente em títulos específicos."
          },
          "provider_game_code": {
            "type": "string"
          },
          "provider_source_game_id": {
            "type": "string",
            "description": "Campo opcional, presente somente em títulos específicos.",
            "nullable": true
          },
          "legacy_game_code": {
            "type": "string",
            "nullable": true
          },
          "image_url": {
            "type": "string",
            "format": "uri"
          },
          "mobile": {
            "type": "boolean",
            "description": "Campo opcional, presente somente em títulos específicos."
          },
          "desktop": {
            "type": "boolean",
            "description": "Campo opcional, presente somente em títulos específicos."
          },
          "distribution": {
            "type": "string"
          },
          "status": {
            "type": "boolean"
          },
          "original": {
            "type": "boolean"
          },
          "provider": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              }
            }
          },
          "wallet_type": {
            "type": "string",
            "enum": [
              "balance",
              "balance_playfiver",
              "balance_playfiverPremium"
            ],
            "description": "Carteira comercial para lançamento"
          },
          "wallet_catalog": {
            "type": "string",
            "description": "Catálogo comercial: standard, playfiver ou live."
          },
          "rounds_free": {
            "type": "boolean",
            "description": "Indica suporte de catálogo a rodadas grátis; a concessão depende de liberação operacional."
          },
          "currency": {
            "type": "string",
            "description": "Campo opcional em títulos específicos."
          },
          "game_type": {
            "type": "string",
            "example": "live",
            "description": "Classificação opcional da vitrine: live para entradas da carteira Ao Vivo. Não altera o game_type nem o envelope do callback financeiro."
          }
        }
      },
      "AgentConfigUpdateRequest": {
        "type": "object",
        "required": [
          "agentToken",
          "secretKey"
        ],
        "properties": {
          "agentToken": {
            "type": "string"
          },
          "secretKey": {
            "type": "string"
          },
          "rtp": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "bonus_enable": {
            "type": "boolean"
          },
          "limit_enable": {
            "type": "boolean"
          },
          "limit_amount": {
            "type": "number",
            "format": "float"
          },
          "limit_hours": {
            "type": "integer"
          },
          "dreamtech_bonus_enable": {
            "type": "boolean"
          }
        }
      },
      "AgentConfigResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 1
          },
          "data": {
            "type": "object",
            "properties": {
              "rtp": {
                "type": "integer"
              },
              "bonus_enable": {
                "type": "boolean"
              },
              "limit_enable": {
                "type": "boolean"
              },
              "limit_amount": {
                "type": "number",
                "format": "float"
              },
              "limit_hours": {
                "type": "integer"
              },
              "dreamtech_bonus_enable": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "FreeBonusCreateRequest": {
        "type": "object",
        "required": [
          "agentToken",
          "secretKey",
          "game_code",
          "rounds"
        ],
        "properties": {
          "agentToken": {
            "type": "string"
          },
          "secretKey": {
            "type": "string"
          },
          "target_scope": {
            "type": "string",
            "enum": [
              "individual",
              "general"
            ],
            "default": "individual",
            "description": "No modo general, o envio é limitado aos jogadores do agente autenticado."
          },
          "user_code": {
            "type": "string",
            "description": "Obrigatório quando target_scope é individual."
          },
          "game_code": {
            "type": "string"
          },
          "rounds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "idempotency_key": {
            "type": "string",
            "maxLength": 191,
            "description": "Chave única do cliente para impedir duplicidade."
          }
        }
      },
      "FreeBonusDeleteRequest": {
        "type": "object",
        "required": [
          "agentToken",
          "secretKey",
          "id"
        ],
        "properties": {
          "agentToken": {
            "type": "string"
          },
          "secretKey": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          }
        }
      },
      "FreeBonusListResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean"
          },
          "msg": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "BalanceCallback": {
        "type": "object",
        "required": [
          "type",
          "user_code"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "BALANCE"
            ]
          },
          "user_code": {
            "type": "string"
          }
        }
      },
      "WinBetCallback": {
        "$ref": "#/components/schemas/FinancialCallback"
      },
      "RefundCallback": {
        "$ref": "#/components/schemas/FinancialCallback"
      },
      "FinancialCallback": {
        "type": "object",
        "required": [
          "type",
          "game_type",
          "user_code",
          "agent_code",
          "agent_secret",
          "user_balance",
          "slot"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "WinBet",
              "REFUND"
            ]
          },
          "game_type": {
            "type": "string"
          },
          "user_code": {
            "type": "string"
          },
          "agent_code": {
            "type": "string"
          },
          "agent_secret": {
            "type": "string"
          },
          "user_balance": {
            "type": "number",
            "format": "float"
          },
          "slot": {
            "type": "object"
          }
        },
        "description": "Envelope legado WinBet/REFUND com type no topo. Não usar como validador universal de transaction/slot ou Fortune Rabbit; consulte TransactionSlotCallback e RabbitAtomicCallback."
      },
      "CallbackSuccessResponse": {
        "type": "object",
        "description": "Modelo legado de resposta. A confirmação exige 2xx e JSON positivo após commit. Outros envelopes homologados podem usar DeliveryAcknowledgement. Ausência de confirmação segue a política do adaptador e pode exigir conciliação sem reenvio.",
        "required": [
          "status",
          "msg",
          "balance"
        ],
        "properties": {
          "status": {
            "type": "integer",
            "example": 1
          },
          "msg": {
            "type": "string",
            "example": "SUCCESS"
          },
          "balance": {
            "type": "number",
            "format": "float"
          },
          "user_balance": {
            "type": "number",
            "format": "float"
          }
        }
      },
      "OperatorReconciliationIdentity": {
        "type": "object",
        "required": [
          "agent_code",
          "user_code",
          "txn_id",
          "provider_code",
          "game_code",
          "currency",
          "bet_cents",
          "win_cents"
        ],
        "properties": {
          "agent_code": {
            "type": "string"
          },
          "user_code": {
            "type": "string"
          },
          "txn_id": {
            "type": "string"
          },
          "provider_code": {
            "type": "string"
          },
          "game_code": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": [
              "BRL"
            ]
          },
          "bet_cents": {
            "type": "integer",
            "minimum": 0
          },
          "win_cents": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "OperatorReconciliationRequest": {
        "type": "object",
        "required": [
          "version",
          "request_id",
          "transaction",
          "method"
        ],
        "properties": {
          "version": {
            "type": "string",
            "enum": [
              "dtg-reconciliation-v1"
            ]
          },
          "request_id": {
            "type": "string",
            "pattern": "^[a-f0-9]{32}$"
          },
          "transaction": {
            "$ref": "#/components/schemas/OperatorReconciliationIdentity"
          },
          "method": {
            "type": "string",
            "enum": [
              "transaction_status"
            ]
          }
        }
      },
      "OperatorReconciliationResponse": {
        "type": "object",
        "required": [
          "version",
          "request_id",
          "transaction",
          "state"
        ],
        "properties": {
          "version": {
            "type": "string",
            "enum": [
              "dtg-reconciliation-v1"
            ]
          },
          "request_id": {
            "type": "string",
            "pattern": "^[a-f0-9]{32}$"
          },
          "transaction": {
            "$ref": "#/components/schemas/OperatorReconciliationIdentity"
          },
          "state": {
            "type": "string",
            "enum": [
              "applied",
              "processing",
              "not_found",
              "rejected"
            ]
          },
          "receipt_id": {
            "type": "string",
            "maxLength": 191,
            "description": "Required for applied; durable operator receipt"
          },
          "authoritative": {
            "type": "boolean",
            "description": "Must be true for not_found"
          }
        }
      },
      "TransactionSlotCallback": {
        "type": "object",
        "description": "Envelope central PlayFiver/iGameWin observado. Não exige type no topo nem round_id/type/timestamp em slot. Não substitui os contratos dos jogos próprios.",
        "required": [
          "method",
          "game_type",
          "user_code",
          "agent_code",
          "agent_secret",
          "user_balance",
          "slot"
        ],
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "transaction"
            ]
          },
          "game_type": {
            "type": "string",
            "example": "slot"
          },
          "user_code": {
            "type": "string"
          },
          "agent_code": {
            "type": "string"
          },
          "agent_secret": {
            "type": "string"
          },
          "agent_token": {
            "type": "string",
            "description": "Presente quando configurado no agente."
          },
          "user_balance": {
            "type": "number"
          },
          "wallet_catalog": {
            "type": "string"
          },
          "wallet_type": {
            "type": "string"
          },
          "slot": {
            "type": "object",
            "required": [
              "provider_code",
              "game_code",
              "txn_id",
              "txn_type",
              "bet_money",
              "win_money"
            ],
            "properties": {
              "provider_code": {
                "type": "string"
              },
              "game_code": {
                "type": "string"
              },
              "txn_id": {
                "type": "string",
                "description": "ID opaco enviado ao operador; manter o prefixo igw: quando presente."
              },
              "txn_type": {
                "type": "string"
              },
              "bet_money": {
                "type": "number",
                "minimum": 0
              },
              "win_money": {
                "type": "number",
                "minimum": 0
              },
              "round_id": {
                "type": "string",
                "description": "Condicional; não garantido neste envelope."
              },
              "type": {
                "type": "string",
                "description": "Condicional por título."
              },
              "timestamp": {
                "type": "string",
                "description": "Condicional; formato depende do contrato."
              },
              "source_txn_id": {
                "type": "string"
              },
              "source_game_code": {
                "type": "string"
              }
            }
          }
        }
      },
      "RabbitAtomicCallback": {
        "type": "object",
        "description": "Exemplo específico Rabbit, sem type obrigatório no topo. Aplicar aposta e prêmio atomicamente; preservar IDs e aliases do contrato homologado.",
        "required": [
          "transaction_id",
          "user_code",
          "agent_code",
          "agent_secret",
          "bet",
          "win"
        ],
        "properties": {
          "transaction_id": {
            "type": "string"
          },
          "txn_id": {
            "type": "string"
          },
          "user_code": {
            "type": "string"
          },
          "agent_code": {
            "type": "string"
          },
          "agent_secret": {
            "type": "string"
          },
          "round_id": {
            "type": "string"
          },
          "bet": {
            "type": "number",
            "minimum": 0
          },
          "win": {
            "type": "number",
            "minimum": 0
          },
          "slot": {
            "type": "object"
          }
        }
      },
      "DeliveryAcknowledgement": {
        "type": "object",
        "description": "Confirmação semântica positiva após commit; exemplos por contrato. Qualquer código de erro ou ID divergente invalida o ACK. receipt_id é recomendado em novas homologações, sem imposição aos clientes atuais.",
        "anyOf": [
          {
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "enum": [
                  1,
                  "1",
                  "success",
                  "SUCCESS",
                  "ok",
                  "OK"
                ]
              }
            }
          },
          {
            "required": [
              "ok"
            ],
            "properties": {
              "ok": {
                "enum": [
                  true
                ]
              }
            }
          },
          {
            "required": [
              "success"
            ],
            "properties": {
              "success": {
                "enum": [
                  true
                ]
              }
            }
          }
        ],
        "properties": {
          "txn_id": {
            "type": "string"
          },
          "receipt_id": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-dtg-operator-reconciliation": {
    "version": "dtg-reconciliation-v1",
    "hosted_by": "operator",
    "method": "POST",
    "url": "New agents: registered HTTPS callback URL; existing dedicated homologated endpoints remain valid.",
    "enabled_by_default": false,
    "request_signature": "Ed25519 X-DTG-Signature; see /developer",
    "response_signature": "X-DTG-Reconciliation-Signature: v1:HMAC-SHA256(secret=agent_secret, message=DTG-RECONCILIATION-RESPONSE-V1 + LF + request_id + LF + sha256(raw_response))",
    "states": [
      "applied",
      "processing",
      "not_found",
      "rejected"
    ],
    "automatic_replay_default": false,
    "documentation": "https://app.dreamtechgames.fun/developer",
    "request_schema": {
      "$ref": "#/components/schemas/OperatorReconciliationRequest"
    },
    "response_schema": {
      "$ref": "#/components/schemas/OperatorReconciliationResponse"
    },
    "required_for_new_integrations": true,
    "existing_contracts_preserved": true,
    "activation": "Automatically validated at the registered callback. New agents stay pending until a signed authoritative not_found response to a fictional zero-value transaction is validated. No financial replay."
  },
  "x-dtg-delivery-integrity": {
    "version": "documentation-20261019",
    "compatibility": "Existing wire contracts unchanged. No automatic legacy replay.",
    "ack": "2xx plus explicit positive JSON only after durable commit.",
    "external_central_failure": "reconciliation_required; no blind financial retries.",
    "identity": "agent + player + provider + outbound event ID; preserve opaque strings.",
    "igamewin_outbound_id": "igw:<receipt>; source_txn_id is not the outbound event ID.",
    "conditional_fields": [
      "slot.round_id",
      "slot.type",
      "slot.timestamp"
    ],
    "round_count": "Current panel counts paid bet records (bet > 0), not callbacks.",
    "ggr": "paid bets minus corresponding gross prizes, including prize-only events; deposits excluded.",
    "recovery": "Per-adapter captured ACK verification; receiver status lookup is required for new integrations and activated after per-agent homologation. Existing wire contracts remain valid.",
    "documentation": "/developer",
    "recovery_coverage": "Registered central/runtime stages use captured positive responses or identical committed internal receipts appropriate to the stage; Aviator close preserves its atomic owner. No recovery replay of pre-activation records.",
    "operator_status_direction": "Optional read-only query to the operator server, explicitly enabled; existing callbacks continue unchanged."
  },
  "x-dtg-callback-contracts": {
    "legacy-type": {
      "$ref": "#/components/schemas/FinancialCallback"
    },
    "playfiver-igamewin-central": {
      "$ref": "#/components/schemas/TransactionSlotCallback"
    },
    "rabbit-specific": {
      "$ref": "#/components/schemas/RabbitAtomicCallback"
    },
    "ack": {
      "$ref": "#/components/schemas/DeliveryAcknowledgement"
    }
  },
  "x-dtg-integration-homologation": {
    "documentation_revision": "2026-11-14",
    "new_integrations_required": [
      "read_only_transaction_status",
      "durable_receipt_after_commit",
      "persistent_idempotency_including_concurrent_repeats"
    ],
    "existing_integrations": "Current wire contracts remain valid; the same new functions can be added after explicit homologation without replacing the financial callback.",
    "activation": "Automatically validated at the registered callback. New agents stay pending until a signed authoritative not_found response to a fictional zero-value transaction is validated. No financial replay.",
    "financial_ack_for_new_integrations": {
      "positive_commit_required": true,
      "additional_fields": [
        "txn_id",
        "receipt_id"
      ],
      "preserve_title_specific_response_fields": true
    },
    "sandbox_only": true,
    "production_release_condition": "New integrations may go live only after signed read-only transaction status, durable commit receipt and persistent idempotency have been implemented and verified."
  }
}
