Make a Resend Callback Webhook Simulation
Resend Callback Webhook Simulation Endpoint
Create a webhook simulation to cash out operation.
https://sandbox.tickpay.com/api/v1/simulations/resend/callback
warning
This functionality is only available for the SANDBOX environment.
Request
To access this endpoint, you need to provide a valid access token in the Authorization header.
- cURL
- C#
- JavaScript
- Python
- Java
- PHP
Use the following cURL command to create a cash out operation:
curl -X 'POST' \
'https://sandbox.tickpay.com/api/v1/simulations/resend/callback' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"id": "transaction_id",
"newCallbackUrl": "https://example.com/callback"
}'
Use the following csharp command to create a cash out operation:
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var url = "https://sandbox.tickpay.com/api/v1/simulations/resend/callback";
var transactionId = "transaction_id";
var newCallbackUrl = "https://example.com/callback";
var payload = new
{
id = transactionId,
newCallbackUrl = newCallbackUrl
};
using (var client = new HttpClient())
{
var jsonPayload = Newtonsoft.Json.JsonConvert.SerializeObject(payload);
var content = new StringContent(jsonPayload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Callback request sent successfully!");
}
else
{
Console.WriteLine($"Error: {response.StatusCode}");
}
}
}
}
Use the following javascript command to create a cash out operation:
const url = 'https://sandbox.tickpay.com/api/v1/simulations/resend/callback';
const transactionId = 'transaction_id';
const newCallbackUrl = 'https://example.com/callback';
const data = {
id: transactionId,
newCallbackUrl: newCallbackUrl
};
fetch(url, {
method: 'POST',
headers: {
'accept': '*/*',
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => {
console.log('Server response:', result);
})
.catch(error => {
console.error('Error when making a request:', error);
});
Use the following python command to create a cash out operation:
import requests
url = 'https://sandbox.tickpay.com/api/v1/simulations/resend/callback'
headers = {
'accept': '*/*',
'Content-Type': 'application/json'
}
data = {
"id": "transaction_id",
"newCallbackUrl": "https://example.com/callback"
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print("Requisição bem-sucedida!")
else:
print(f"Erro na requisição. Código de status: {response.status_code}")
Use the following java command to create a cash out operation:
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) {
try {
String url = "https://sandbox.tickpay.com/api/v1/simulations/resend/callback";
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("accept", "*/*");
con.setRequestProperty("Content-Type", "application/json");
String data = "{\"id\": \"transaction_id\", \"newCallbackUrl\": \"https://example.com/callback\"}";
con.setDoOutput(true);
OutputStream os = con.getOutputStream();
os.write(data.getBytes());
os.flush();
os.close();
int responseCode = con.getResponseCode();
if (responseCode == 200) {
System.out.println("Requisição bem-sucedida!");
} else {
System.out.println("Erro na requisição. Código de status: " + responseCode);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Use the following php command to create a cash out operation:
<?php
$url = 'https://sandbox.tickpay.com/api/v1/simulations/resend/callback';
$data = array(
'id' => 'transaction_id',
'newCallbackUrl' => 'https://example.com/callback'
);
$options = array(
'http' => array(
'header' => "Content-Type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result !== false) {
echo "Requisição bem-sucedida!";
} else {
echo "Erro na requisição.";
}
?>
Request body
| Parameter | Description | Required |
|---|---|---|
id | Transaction ID. | true |
newCallbackUrl | New URL callback. | false |
Response
The response will contain a data object, along with additional information:
{
"data": null,
"messageError": null,
"success": true
}
Response Properties
| Parameter | Description | Default Value |
|---|---|---|
messageError | Error message. | null |
success | Indicates whether the request was successful. | false |
data | null |