📄 Documentação GokuPay API


Base URL

https://gokupay.fun/api

1️⃣ Autenticação

Realize a autenticação com suas credenciais de login. Use o TOKEN para fazer as requisições de Depósito e Saque.

Endpoint
POST /get_auth_token.php
Parâmetros
CampoTipoRequiredDescrição
emailstringSeu email
senhastringSua senha
Exemplo (PHP cURL)
<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://gokupay.fun/api/get_auth_token.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
    "email" => "user@example.com",
    "senha" => "mySecurePass123"
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
Exemplo de Resposta
{
    "token": "c3d6b8e0a41f4f29a7f8b8d9f27d932e"
}

2️ Depósito

Cria uma nova requisição de Depósito. Assim que processado, a API enviará uma requisição POST para o seu callback_url.

Endpoint
POST /deposit.php
Headers
NomeRequiredDescrição
AuthorizationToken obtido na Autenticação
Parâmetros
CampoTipoRequiredDescrição
namestringNome do cliente
cpfstringCPF do cliente (Somente números)
amountnumberValor do depósito
callback_urlstringURL do seu webhook
Exemplo (PHP cURL)
<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://gokupay.fun/api/deposit.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: c3d6b8e0a41f4f29a7f8b8d9f27d932e"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
    "name" => "Maria Silva",
    "cpf" => "12345678901",
    "amount" => 150.50,
    "callback_url" => "https://example.com/seu_webhook"
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
Exemplo Callback Payload
{
    "status": "ok",
    "data": {
        "transaction_id": "abcdef12-3456-7890-abcd-ef1234567890",
        "status": "PENDING",
        "amount": 150.50,
        "qrCode": "00020126580014BR.GOV.BCB.PIX0114+551199999999520400005303986540512.005802BR5925Nome do Recebedor6009SAO PAULO61080540900062170503***6304B14F",
        "qrImageb64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA..."
    }
}

3️⃣ Withdrawal

Realiza um saque via PIX.

Endpoint
POST /withdraw.php
Headers
NomeRequiredDescrição
AuthorizationToken obtido na Autenticação
Parameters
CampoTipoRequiredDescrição
namestringNome do recebedor
cpfstringCPF do recebedor
pix_keystringChave PIX do recebedor
pix_typestringTipo da Chave PIX (CPF ou CNPJ)
amountnumberValor do saque
callback_urlstringURL do seu webhook
Exemplo (PHP cURL)
<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://gokupay.fun/api/withdraw.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: c3d6b8e0a41f4f29a7f8b8d9f27d932e"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
    "name" => "João Pereira",
    "cpf" => "98765432100",
    "pix_key" => "98765432100",
    "pix_type" => "cpf",
    "amount" => 150.50,
    "callback_url" => "https://example.com/seu_webhook"
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
Exemplo Callback Payload
{
    "status": "ok",
    "data": {
        "transaction_id": "abcdef12-3456-7890-abcd-ef1234567890",
        "status": "PENDING",
        "amount": 150.50
    }
}

4️⃣ Webhooks

Os webhooks enviados para o seu sistema.

Depósito
{
    "transaction_id": "abcdef12-3456-7890-abcd-ef1234567890",
    "status": "PAID",
    "amount": 150.50,
    "type": "deposit",
    "callback_url": "https://example.com/seu_webhook"
}
Saque
{
    "transaction_id": "abcdef12-3456-7890-abcd-ef1234567890",
    "status": "PAID",
    "amount": 150.50,
    "type": "deposit",
    "callback_url": "https://example.com/seu_webhook"
}