📄 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
| Campo | Tipo | Required | Descrição |
| email | string | ✅ | Seu email |
| senha | string | ✅ | Sua 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
| Nome | Required | Descrição |
| Authorization | ✅ | Token obtido na Autenticação |
Parâmetros
| Campo | Tipo | Required | Descrição |
| name | string | ✅ | Nome do cliente |
| cpf | string | ✅ | CPF do cliente (Somente números) |
| amount | number | ✅ | Valor do depósito |
| callback_url | string | ✅ | URL 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
| Nome | Required | Descrição |
| Authorization | ✅ | Token obtido na Autenticação |
Parameters
| Campo | Tipo | Required | Descrição |
| name | string | ✅ | Nome do recebedor |
| cpf | string | ✅ | CPF do recebedor |
| pix_key | string | ✅ | Chave PIX do recebedor |
| pix_type | string | ✅ | Tipo da Chave PIX (CPF ou CNPJ) |
| amount | number | ✅ | Valor do saque |
| callback_url | string | ✅ | URL 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"
}