Resend transaction webhook
POST /api/resend-webhook/{transactionIdentifier}
POST https://api.avista.global/api/resend-webhook/{transactionIdentifier}Requires a Bearer token in the Authorization header. See Generate Token to obtain one.
Resends the webhook of a specific transaction to the configured URL or to a temporary URL (override).
The transaction identifier can be:
- Numeric transaction ID: The ID returned by Avista (
transactionIdfield in webhooks) - Your reference ID: The identifier you provided when creating the transaction (
externalId) - PIX End-to-End ID: The
e2eIdreturned in webhooks (format: E/D + 32 chars)
Authentication
Requires a Bearer token in the Authorization header.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
transactionIdentifier | string | Yes | Transaction identifier: numeric id, externalId, or endToEndId |
Request Body (optional)
| Field | Type | Required | Description |
|---|---|---|---|
url | string | No | Temporary URL for this specific resend. If not provided, uses the URL configured in the account webhook. The URL is not persisted |
{
"url": "https://meu-servidor.com/webhooks/avista"
}URL Behavior
- If
urlis provided in the body, uses that URL temporarily (not persisted) - If
urlis not provided, uses the URL configured in the account webhook for the operation type - If no URL is available, returns error 400
Code Examples
curl -X POST "https://api.avista.global/api/resend-webhook/PAG-2024-0001" \
-H "Authorization: Bearer $AVISTA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://meu-servidor.com/webhooks/avista"
}'const axios = require('axios');
const response = await axios.post('https://api.avista.global/api/resend-webhook/PAG-2024-0001',
{
"url": "https://meu-servidor.com/webhooks/avista"
},
{
headers: {
'Authorization': `Bearer ${process.env.AVISTA_TOKEN}`,
'Content-Type': 'application/json',
},
}
);
console.log(response.data);import os, requests
response = requests.post(
'https://api.avista.global/api/resend-webhook/PAG-2024-0001',
headers={
'Authorization': f'Bearer {os.environ["AVISTA_TOKEN"]}',
'Content-Type': 'application/json',
},
json={
"url": "https://meu-servidor.com/webhooks/avista"
},
)
print(response.json())$ch = curl_init('https://api.avista.global/api/resend-webhook/PAG-2024-0001');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('AVISTA_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{
"url": "https://meu-servidor.com/webhooks/avista"
}',
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;String body = """
{
"url": "https://meu-servidor.com/webhooks/avista"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.avista.global/api/resend-webhook/PAG-2024-0001"))
.header("Authorization", "Bearer " + System.getenv("AVISTA_TOKEN"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Response (200)
| Field | Type | Description |
|---|---|---|
message | string | Descriptive message of the result |
webhookLogId | number | Webhook log ID generated for auditing |
sentAt | string | Webhook send date/time (ISO 8601) |
statusCode | number | HTTP status code returned by the destination URL |
{
"message": "Webhook resent successfully",
"webhookLogId": 12345,
"sentAt": "2024-01-15T10:30:00.000Z",
"statusCode": 200
}Errors
| Status | Description |
|---|---|
| 400 | No webhook URL available. Configure a webhook for this transaction's operation type or provide a temporary URL in the url field |
| 401 | Invalid, expired, or missing token |
| 404 | Transaction not found or does not belong to the authenticated account |
| 429 | Rate limit exceeded (max 60 req/min) |