Simular saque (Sandbox)
curl --request POST \
--url https://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"action": 1
}'import requests
url = "https://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate"
payload = { "action": 1 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({action: 1})
};
fetch('https://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate"
payload := strings.NewReader("{\n \"action\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": 1\n}")
.asString();{
"data": {
"id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"externalId": "saque_001",
"amount": 50000,
"fee": 200,
"netAmount": 49800,
"currency": "BRL",
"status": "Completed",
"environment": "Sandbox",
"pix": {
"pixKeyType": "CPF",
"pixKey": "***456789**",
"endToEndId": "E12345678202501151600xyz789abc012",
"acquirerTransactionId": "SANDBOX_TXN_001"
},
"requestedAt": "2025-01-15T16:00:00Z",
"processedAt": "2025-01-15T16:02:00Z",
"completedAt": "2025-01-15T16:05:00Z",
"failureReason": null,
"createdAt": "2025-01-15T16:00:00Z"
},
"message": "Saque simulado com sucesso.",
"error": null
}{
"data": null,
"message": null,
"error": {
"message": "O saque precisa estar com status Pending para simular Complete.",
"code": "invalid_status"
}
}{
"data": null,
"message": null,
"error": {
"message": "Este endpoint esta disponivel apenas em ambiente Sandbox.",
"code": "sandbox_only"
}
}{
"data": null,
"message": null,
"error": {
"message": "Saque nao encontrado.",
"code": "not_found"
}
}Saques
Simular saque
Simule o processamento de um saque no Sandbox
POST
/
v1
/
cashouts
/
{id}
/
simulate
Simular saque (Sandbox)
curl --request POST \
--url https://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"action": 1
}'import requests
url = "https://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate"
payload = { "action": 1 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({action: 1})
};
fetch('https://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate"
payload := strings.NewReader("{\n \"action\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": 1\n}")
.asString();{
"data": {
"id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"externalId": "saque_001",
"amount": 50000,
"fee": 200,
"netAmount": 49800,
"currency": "BRL",
"status": "Completed",
"environment": "Sandbox",
"pix": {
"pixKeyType": "CPF",
"pixKey": "***456789**",
"endToEndId": "E12345678202501151600xyz789abc012",
"acquirerTransactionId": "SANDBOX_TXN_001"
},
"requestedAt": "2025-01-15T16:00:00Z",
"processedAt": "2025-01-15T16:02:00Z",
"completedAt": "2025-01-15T16:05:00Z",
"failureReason": null,
"createdAt": "2025-01-15T16:00:00Z"
},
"message": "Saque simulado com sucesso.",
"error": null
}{
"data": null,
"message": null,
"error": {
"message": "O saque precisa estar com status Pending para simular Complete.",
"code": "invalid_status"
}
}{
"data": null,
"message": null,
"error": {
"message": "Este endpoint esta disponivel apenas em ambiente Sandbox.",
"code": "sandbox_only"
}
}{
"data": null,
"message": null,
"error": {
"message": "Saque nao encontrado.",
"code": "not_found"
}
}Simula o processamento de um saque no ambiente Sandbox. Use para testar fluxos de saque sem dinheiro real.
Disponível apenas no ambiente Sandbox.
Autorizações
Token JWT obtido via /v1/auth/token
Parâmetros de caminho
ID do saque
Exemplo:
"b2c3d4e5-f6a7-8901-bcde-f23456789012"
Corpo
application/json
Acao: 1=Complete, 2=Fail, 3=Reject
Opções disponíveis:
1, 2, 3 Exemplo:
1