Skip to main content

Resend Webhook

This endpoint allows you to force the resending of a webhook notification for a specific withdrawal transaction.


Endpoint​

  • Method: POST
Endpoint URL
https://api.xgateglobal.com/withdraw/TRANSACTION_ID/resend/webhook
Important

The TRANSACTION_ID value in the URL refers to the withdrawal's _id. This request does not require a body, only the parameterized URL and the authentication Header.


Request​

Required Headers​

HeaderValueDescription
AuthorizationBearer <your_token>JWT authentication token obtained at login.

Responses​

Success (200 OK)​

The command was received and XGate resent the webhook payload to the URL registered in your dashboard.

{
"message": "Webhook de saque reenviado com sucesso"
}

Common Errors​

StatusMessageProbable Cause
401Unauthorized• Invalid or expired token.
• Header invalid or not provided.
• IP not allowed.
• You are not authorized to perform this action.
404Not Found• Provided ID is invalid.
• The transaction does not exist.
500Internal Server ErrorInternal server error. Contact support.

How to Use​

This is a contingency and maintenance route. Unlike query routes, it performs an active action in XGate, causing our server to trigger the HTTP notification to your system again.

Common Use Cases​

You will use this endpoint mainly for:

  1. Failure Recovery: If your server experienced instability, crashed, or the firewall blocked the original XGate request, you can use this endpoint to "pull" the notification again and update the status in your database.
  2. Integration Tests: During the development phase, you can trigger the webhook of an old transaction multiple times to test if your receiving code's logic is working correctly.

Practical Example​

Simply make a POST to the URL providing the transaction ID. You will receive a success message confirming that the trigger was activated.

{
"message": "Webhook de saque reenviado com sucesso"
}

Integration​

Below is a simple example of how to implement this call using Node.js. Since it is a POST without a body, we simply send an empty object {} followed by the headers.

The integration example uses the Axios library to perform the HTTP request.

Installing Axios:

npm install axios

Javascript Example:

const axios = require("axios");

(async () => {
const email = "email@domain.com";
const password = "••••••";
const transactionId = "6997146*******************";

try {
const url_api = "[https://api.xgateglobal.com](https://api.xgateglobal.com)";

// 1. Get authentication token
const login = await axios.post(`${url_api}/auth/token`, { email, password });

// 2. Trigger Webhook resend (POST without body)
const { data } = await axios.post(`${url_api}/withdraw/${transactionId}/resend/webhook`, {}, {
headers: {
"Authorization": `Bearer ${login.data.token}`
}
});

console.log("Response:", data);
// Expected: { message: 'Webhook de saque reenviado com sucesso' }

} catch (error) {
console.error("Resend error:", error.response ? error.response.data : error.message);
}
})();