Obter transacao
curl --request GET \
--url https://api-payment.safefypay.com.br/v1/transactions/{transactionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-payment.safefypay.com.br/v1/transactions/{transactionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-payment.safefypay.com.br/v1/transactions/{transactionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-payment.safefypay.com.br/v1/transactions/{transactionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-payment.safefypay.com.br/v1/transactions/{transactionId}")
.header("Authorization", "Bearer <token>")
.asString();{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"externalId": "pedido_12345",
"method": "Pix",
"amount": 10000,
"fee": 150,
"netAmount": 9850,
"currency": "BRL",
"status": "Completed",
"description": "Pagamento do pedido #12345",
"failureReason": null,
"environment": "Sandbox",
"metadata": "{\"orderId\": 12345}",
"callbackUrl": "https://seusite.com.br/webhook",
"customerId": "550e8400-e29b-41d4-a716-446655440000",
"expiresAt": "2025-01-15T15:30:00Z",
"completedAt": "2025-01-15T15:10:00Z",
"refundedAt": null,
"createdAt": "2025-01-15T15:00:00Z",
"updatedAt": "2025-01-15T15:10:00Z",
"pix": {
"txId": "SAFEFY2025011512345678901234",
"endToEndId": "E12345678202501151510abc123def456",
"qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA...",
"copyAndPaste": "00020126580014br.gov.bcb.pix0136a1b2c3d4...",
"payerName": "Joao Silva",
"payerDocument": "***456789**",
"payerBank": "Banco do Brasil",
"expiresAt": "2025-01-15T15:30:00Z"
},
"card": null,
"boleto": null,
"customer": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Joao Silva",
"email": "joao@email.com",
"document": "123.456.789-00",
"phone": "5511999998888"
}
},
"message": null,
"error": null
}{
"data": null,
"message": null,
"error": {
"message": "Token invalido ou expirado.",
"code": "unauthorized"
}
}{
"data": null,
"message": null,
"error": {
"message": "Transacao nao encontrada.",
"code": "not_found"
}
}Transactions
Get transaction
Retrieve a transaction by ID
GET
/
v1
/
transactions
/
{transactionId}
Obter transacao
curl --request GET \
--url https://api-payment.safefypay.com.br/v1/transactions/{transactionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-payment.safefypay.com.br/v1/transactions/{transactionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-payment.safefypay.com.br/v1/transactions/{transactionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-payment.safefypay.com.br/v1/transactions/{transactionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-payment.safefypay.com.br/v1/transactions/{transactionId}")
.header("Authorization", "Bearer <token>")
.asString();{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"externalId": "pedido_12345",
"method": "Pix",
"amount": 10000,
"fee": 150,
"netAmount": 9850,
"currency": "BRL",
"status": "Completed",
"description": "Pagamento do pedido #12345",
"failureReason": null,
"environment": "Sandbox",
"metadata": "{\"orderId\": 12345}",
"callbackUrl": "https://seusite.com.br/webhook",
"customerId": "550e8400-e29b-41d4-a716-446655440000",
"expiresAt": "2025-01-15T15:30:00Z",
"completedAt": "2025-01-15T15:10:00Z",
"refundedAt": null,
"createdAt": "2025-01-15T15:00:00Z",
"updatedAt": "2025-01-15T15:10:00Z",
"pix": {
"txId": "SAFEFY2025011512345678901234",
"endToEndId": "E12345678202501151510abc123def456",
"qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA...",
"copyAndPaste": "00020126580014br.gov.bcb.pix0136a1b2c3d4...",
"payerName": "Joao Silva",
"payerDocument": "***456789**",
"payerBank": "Banco do Brasil",
"expiresAt": "2025-01-15T15:30:00Z"
},
"card": null,
"boleto": null,
"customer": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Joao Silva",
"email": "joao@email.com",
"document": "123.456.789-00",
"phone": "5511999998888"
}
},
"message": null,
"error": null
}{
"data": null,
"message": null,
"error": {
"message": "Token invalido ou expirado.",
"code": "unauthorized"
}
}{
"data": null,
"message": null,
"error": {
"message": "Transacao nao encontrada.",
"code": "not_found"
}
}Retrieves a specific transaction by its unique identifier.
After payment is confirmed, the following fields are populated in the
pix object:
pix.payerName, pix.payerDocument, pix.payerBank, and pix.endToEndId.For boleto transactions, data is available in boleto.barcode, boleto.digitableLine, boleto.pdfUrl, and boleto.dueDate.Authorizations
Token JWT obtido via /v1/auth/token
Path Parameters
ID da transacao
Example:
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"