curl --request POST \
--url https://public-api.kiwify.com/v1/payouts/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-kiwify-account-id: <api-key>' \
--data '{
"amount": 5000
}'import requests
url = "https://public-api.kiwify.com/v1/payouts/"
payload = { "amount": 5000 }
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-kiwify-account-id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-kiwify-account-id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 5000})
};
fetch('https://public-api.kiwify.com/v1/payouts/', 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://public-api.kiwify.com/v1/payouts/",
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([
'amount' => 5000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-kiwify-account-id: <api-key>"
],
]);
$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://public-api.kiwify.com/v1/payouts/"
payload := strings.NewReader("{\n \"amount\": 5000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-kiwify-account-id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://public-api.kiwify.com/v1/payouts/")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-kiwify-account-id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.kiwify.com/v1/payouts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-kiwify-account-id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 5000\n}"
response = http.request(request)
puts response.read_body{
"id": "8606aae0-e036-4e55-998a-e0a8de7bf54f"
}Realizar um saque
Solicita a realização de um saque. Exige o cabeçalho Idempotency-Key, um UUID gerado por você que identifica o saque. Este endpoint é de natureza síncrona, o que significa que você terá uma resposta imediata, porém, para saber o status da solicitação, será necessário consultar o dashboard, no menu financeiro, na aba “Saques”.
curl --request POST \
--url https://public-api.kiwify.com/v1/payouts/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-kiwify-account-id: <api-key>' \
--data '{
"amount": 5000
}'import requests
url = "https://public-api.kiwify.com/v1/payouts/"
payload = { "amount": 5000 }
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-kiwify-account-id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-kiwify-account-id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 5000})
};
fetch('https://public-api.kiwify.com/v1/payouts/', 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://public-api.kiwify.com/v1/payouts/",
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([
'amount' => 5000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-kiwify-account-id: <api-key>"
],
]);
$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://public-api.kiwify.com/v1/payouts/"
payload := strings.NewReader("{\n \"amount\": 5000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-kiwify-account-id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://public-api.kiwify.com/v1/payouts/")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-kiwify-account-id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.kiwify.com/v1/payouts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-kiwify-account-id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 5000\n}"
response = http.request(request)
puts response.read_body{
"id": "8606aae0-e036-4e55-998a-e0a8de7bf54f"
}Idempotency-Key é obrigatório. Requisições sem ele são recusadas com 400.Gere um UUID novo para cada saque que pretende criar e reenvie esse mesmo valor, inalterado, em
qualquer nova tentativa da mesma solicitação. Uma retentativa após timeout ou erro de rede
devolve o saque original em vez de criar um segundo — por isso, nunca gere uma chave nova ao
repetir uma solicitação que já pode ter chegado até nós.O UUID enviado é o id do saque, e pode ser usado em seguida para
consultá-lo.Autorizações
The access token received from the authorization server in the OAuth 2.0 flow.
- Token URL
- /oauth/token
Cabeçalhos
Identificador único do saque, gerado por você. Envie um UUID novo para cada saque que pretende criar, e reenvie o mesmo valor, inalterado, em qualquer nova tentativa da mesma solicitação — uma retentativa após timeout ou erro de rede devolve o saque original em vez de criar um segundo. Este UUID é o id do saque, e pode ser usado em seguida para consultá-lo. Requisições sem este cabeçalho são recusadas com 400.
"8606aae0-e036-4e55-998a-e0a8de7bf54f"
Corpo
5000
Resposta
Request Payout
"8606aae0-e036-4e55-998a-e0a8de7bf54f"
