Cadastrar Conta Bancária
curl --request POST \
--url https://api.example.com/bank-accounts \
--header 'Content-Type: application/json' \
--data '
{
"api_token": "<string>",
"type": "<string>",
"pix_key_type": "<string>",
"pix_key": "<string>",
"bank_code": "<string>",
"account_type": "<string>",
"account_number": "<string>",
"agency": "<string>",
"holder_name": "<string>",
"holder_document": "<string>"
}
'import requests
url = "https://api.example.com/bank-accounts"
payload = {
"api_token": "<string>",
"type": "<string>",
"pix_key_type": "<string>",
"pix_key": "<string>",
"bank_code": "<string>",
"account_type": "<string>",
"account_number": "<string>",
"agency": "<string>",
"holder_name": "<string>",
"holder_document": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
api_token: '<string>',
type: '<string>',
pix_key_type: '<string>',
pix_key: '<string>',
bank_code: '<string>',
account_type: '<string>',
account_number: '<string>',
agency: '<string>',
holder_name: '<string>',
holder_document: '<string>'
})
};
fetch('https://api.example.com/bank-accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/bank-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_token' => '<string>',
'type' => '<string>',
'pix_key_type' => '<string>',
'pix_key' => '<string>',
'bank_code' => '<string>',
'account_type' => '<string>',
'account_number' => '<string>',
'agency' => '<string>',
'holder_name' => '<string>',
'holder_document' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/bank-accounts"
payload := strings.NewReader("{\n \"api_token\": \"<string>\",\n \"type\": \"<string>\",\n \"pix_key_type\": \"<string>\",\n \"pix_key\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_type\": \"<string>\",\n \"account_number\": \"<string>\",\n \"agency\": \"<string>\",\n \"holder_name\": \"<string>\",\n \"holder_document\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/bank-accounts")
.header("Content-Type", "application/json")
.body("{\n \"api_token\": \"<string>\",\n \"type\": \"<string>\",\n \"pix_key_type\": \"<string>\",\n \"pix_key\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_type\": \"<string>\",\n \"account_number\": \"<string>\",\n \"agency\": \"<string>\",\n \"holder_name\": \"<string>\",\n \"holder_document\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/bank-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_token\": \"<string>\",\n \"type\": \"<string>\",\n \"pix_key_type\": \"<string>\",\n \"pix_key\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_type\": \"<string>\",\n \"account_number\": \"<string>\",\n \"agency\": \"<string>\",\n \"holder_name\": \"<string>\",\n \"holder_document\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"201": {},
"400": {},
"401": {},
"422": {},
"500": {}
}Contas Bancária
Cadastrar Conta Bancária
Cadastra uma nova conta bancária ou chave PIX para recebimento de saques
POST
/
bank-accounts
Cadastrar Conta Bancária
curl --request POST \
--url https://api.example.com/bank-accounts \
--header 'Content-Type: application/json' \
--data '
{
"api_token": "<string>",
"type": "<string>",
"pix_key_type": "<string>",
"pix_key": "<string>",
"bank_code": "<string>",
"account_type": "<string>",
"account_number": "<string>",
"agency": "<string>",
"holder_name": "<string>",
"holder_document": "<string>"
}
'import requests
url = "https://api.example.com/bank-accounts"
payload = {
"api_token": "<string>",
"type": "<string>",
"pix_key_type": "<string>",
"pix_key": "<string>",
"bank_code": "<string>",
"account_type": "<string>",
"account_number": "<string>",
"agency": "<string>",
"holder_name": "<string>",
"holder_document": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
api_token: '<string>',
type: '<string>',
pix_key_type: '<string>',
pix_key: '<string>',
bank_code: '<string>',
account_type: '<string>',
account_number: '<string>',
agency: '<string>',
holder_name: '<string>',
holder_document: '<string>'
})
};
fetch('https://api.example.com/bank-accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/bank-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_token' => '<string>',
'type' => '<string>',
'pix_key_type' => '<string>',
'pix_key' => '<string>',
'bank_code' => '<string>',
'account_type' => '<string>',
'account_number' => '<string>',
'agency' => '<string>',
'holder_name' => '<string>',
'holder_document' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/bank-accounts"
payload := strings.NewReader("{\n \"api_token\": \"<string>\",\n \"type\": \"<string>\",\n \"pix_key_type\": \"<string>\",\n \"pix_key\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_type\": \"<string>\",\n \"account_number\": \"<string>\",\n \"agency\": \"<string>\",\n \"holder_name\": \"<string>\",\n \"holder_document\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/bank-accounts")
.header("Content-Type", "application/json")
.body("{\n \"api_token\": \"<string>\",\n \"type\": \"<string>\",\n \"pix_key_type\": \"<string>\",\n \"pix_key\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_type\": \"<string>\",\n \"account_number\": \"<string>\",\n \"agency\": \"<string>\",\n \"holder_name\": \"<string>\",\n \"holder_document\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/bank-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_token\": \"<string>\",\n \"type\": \"<string>\",\n \"pix_key_type\": \"<string>\",\n \"pix_key\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"account_type\": \"<string>\",\n \"account_number\": \"<string>\",\n \"agency\": \"<string>\",\n \"holder_name\": \"<string>\",\n \"holder_document\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"201": {},
"400": {},
"401": {},
"422": {},
"500": {}
}Visão Geral
Este endpoint permite cadastrar uma conta bancária ou chave PIX para receber transferências dos valores disponíveis em sua conta KlivoPay.Endpoint
POST https://api.klivopay.com.br/api/public/v1/bank-accounts
Parâmetros
Seu token de autenticação da API KlivoPay
Tipo de conta:
pix ou bankParâmetros para PIX (type = “pix”)
Tipo de chave PIX:
cpf, cnpj, email, phone, randomValor da chave PIX
Parâmetros para Conta Bancária (type = “bank”)
Código do banco (3 dígitos). Exemplo:
001 para Banco do BrasilTipo de conta:
checking (corrente) ou savings (poupança)Número da conta com dígito
Número da agência
Nome completo do titular da conta
CPF ou CNPJ do titular (apenas números)
Exemplo de Requisição
curl -X POST 'https://api.klivopay.com.br/api/public/v1/bank-accounts' \
-H 'Content-Type: application/json' \
-d '{
"api_token": "seu_token_aqui",
"type": "pix",
"pix_key_type": "cpf",
"pix_key": "12345678900"
}'
curl -X POST 'https://api.klivopay.com.br/api/public/v1/bank-accounts' \
-H 'Content-Type: application/json' \
-d '{
"api_token": "seu_token_aqui",
"type": "bank",
"bank_code": "001",
"account_type": "checking",
"account_number": "12345-6",
"agency": "1234",
"holder_name": "João Silva",
"holder_document": "12345678900"
}'
const response = await fetch('https://api.klivopay.com.br/api/public/v1/bank-accounts', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_token: 'seu_token_aqui',
type: 'pix',
pix_key_type: 'email',
pix_key: 'joao@example.com'
})
});
const data = await response.json();
console.log(data);
import requests
url = 'https://api.klivopay.com.br/api/public/v1/bank-accounts'
payload = {
'api_token': 'seu_token_aqui',
'type': 'bank',
'bank_code': '001',
'account_type': 'checking',
'account_number': '12345-6',
'agency': '1234',
'holder_name': 'João Silva',
'holder_document': '12345678900'
}
response = requests.post(url, json=payload)
print(response.json())
<?php
$url = 'https://api.klivopay.com.br/api/public/v1/bank-accounts';
$data = [
'api_token' => 'seu_token_aqui',
'type' => 'pix',
'pix_key_type' => 'phone',
'pix_key' => '11987654321'
];
$options = [
'http' => [
'header' => "Content-Type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data)
]
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
print_r(json_decode($result));
?>
Resposta de Sucesso
201 Created
{
"success": true,
"data": {
"hash": "bank123abc",
"type": "pix",
"pix_key_type": "cpf",
"pix_key": "123.456.789-00",
"status": "active",
"created_at": "2025-01-20T10:15:00Z"
}
}
Códigos de Resposta
Conta bancária cadastrada com sucesso
Dados inválidos na requisição
Token de API inválido ou ausente
Erro de validação nos dados enviados
Erro interno do servidor
Você pode cadastrar múltiplas contas bancárias e escolher qual usar para cada saque.
Contas PIX geralmente processam saques mais rapidamente (até 1 hora) comparado a transferências bancárias tradicionais (1-3 dias úteis).
⌘I