docs

Resend transaction webhook

POST /api/resend-webhook/{transactionIdentifier}

POST https://api.fypay.me/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(s) or to a temporary URL (override).

The transaction identifier can be:

  • Numeric transaction ID: The ID returned by FyPay (transactionId field in webhooks)
  • Your reference ID: The identifier you provided when creating the transaction (externalId)
  • PIX End-to-End ID: The e2eId returned in webhooks (format: E/D + 32 chars)

Authentication

Requires a Bearer token in the Authorization header.

Path Parameters

ParameterTypeRequiredDescription
transactionIdentifierstringYesTransaction identifier: numeric id, externalId, or endToEndId

Request Body (optional)

FieldTypeRequiredDescription
urlstringNoTemporary URL for this specific resend. If not provided, the resend goes to all active URLs configured for the event. If a URL is provided, it uses the headers and payload version of the first active URL for the event. The URL is not persisted
{
  "url": "https://meu-servidor.com/webhooks/fypay"
}

URL Behavior

  • If url is not provided, the resend is sent to all active URLs configured for the event, each with its own custom headers and payload version
  • If url is provided in the body, uses that URL temporarily (not persisted), with the custom headers and payload version of the first active URL configured for the event
  • If no URL is available, returns error 400

The resend goes through the same pipeline as the original send: the payload is rebuilt from the transaction's current state and signed with the account's current HMAC secret in the X-Avista-Signature header (until the signing key is generated in the dashboard, the resend is sent without that header).


Code Examples

cURL
curl -X POST "https://api.fypay.me/api/resend-webhook/PAG-2024-0001" \
  -H "Authorization: Bearer $FYPAY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://meu-servidor.com/webhooks/fypay"
}'
const axios = require('axios');

const response = await axios.post('https://api.fypay.me/api/resend-webhook/PAG-2024-0001',
  {
  "url": "https://meu-servidor.com/webhooks/fypay"
},
  {
    headers: {
      'Authorization': `Bearer ${process.env.FYPAY_TOKEN}`,
      'Content-Type': 'application/json',
    },
  }
);
console.log(response.data);
import os, requests

response = requests.post(
    'https://api.fypay.me/api/resend-webhook/PAG-2024-0001',
    headers={
        'Authorization': f'Bearer {os.environ["FYPAY_TOKEN"]}',
        'Content-Type': 'application/json',
    },
    json={
  "url": "https://meu-servidor.com/webhooks/fypay"
},
)
print(response.json())
$ch = curl_init('https://api.fypay.me/api/resend-webhook/PAG-2024-0001');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('FYPAY_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{
  "url": "https://meu-servidor.com/webhooks/fypay"
}',
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
String body = """
    {
      "url": "https://meu-servidor.com/webhooks/fypay"
    }
    """;
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.fypay.me/api/resend-webhook/PAG-2024-0001"))
    .header("Authorization", "Bearer " + System.getenv("FYPAY_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)

FieldTypeDescription
messagestringDescriptive message of the result
webhookLogIdnumberWebhook log ID generated for auditing
sentAtstringWebhook send date/time (ISO 8601)
statusCodenumberHTTP status code returned by the destination URL
{
  "message": "Webhook resent successfully",
  "webhookLogId": 12345,
  "sentAt": "2024-01-15T10:30:00.000Z",
  "statusCode": 200
}

Errors

StatusDescription
400No webhook URL available. Configure a webhook for this transaction's operation type or provide a temporary URL in the url field
401Invalid, expired, or missing token
404Transaction not found or does not belong to the authenticated account
429Limit of 60 requests per minute per account exceeded. Wait for the window to reset (Retry-After header)
502The target URL responded with a non-2xx status. The body includes message, webhookLogId and sentAt
504The target URL did not respond within 10 seconds. The body includes message, webhookLogId and sentAt

On this page