Make a Cash In Webhook Simulation
Cash In Webhook Simulation Endpoint
Create a webhook simulation cash in operation.
https://sandbox.tickpay.com/api/v1/simulations/cashin/{id}
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 in operation:
curl -X 'GET' \
'https://sandbox.tickpay.com/api/v1/simulations/cashin/id' \
-H 'accept: application/json'
Use the following csharp command to create a cash in operation:
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
string apiUrl = "https://sandbox.tickpay.com/api/v1/simulations/cashin/id";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("accept", "application/json");
HttpResponseMessage response = await client.GetAsync(apiUrl);
if (response.IsSuccessStatusCode)
{
string result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
else
{
Console.WriteLine($"Error: {response.StatusCode} - {response.ReasonPhrase}");
}
}
}
}
Use the following javascript command to create a cash in operation:
const url = 'https://sandbox.tickpay.com/api/v1/simulations/cashin/id';
const headers = {
'accept': 'application/json'
};
fetch(url, {
method: 'GET',
headers: headers
})
.then(response => response.json())
.then(data => {
console.log('Server Response:', data);
})
.catch(error => {
console.error('Request Error:', error);
});
Use the following python command to create a cash in operation:
import requests
url = 'https://sandbox.tickpay.com/api/v1/simulations/cashin/id'
headers = {
'accept': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
Use the following java command to create a cash in operation:
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Map;
public class Example {
public static void main(String[] args) {
HttpClient httpClient = HttpClient.newHttpClient();
String url = "https://sandbox.tickpay.com/api/v1/simulations/cashin/id";
Map<String, String> headers = Map.of(
"accept", "application/json"
);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.headers(headers.entrySet().stream()
.flatMap(e -> Map.entry(e.getKey(), e.getValue()).stream())
.toArray(String[]::new))
.GET()
.build();
try {
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Use the following php command to create a cash in operation:
<?php
$apiUrl = "https://sandbox.tickpay.com/api/v1/simulations/cashin/id";
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPGET, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'accept: application/json'
]);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error: ' . curl_error($ch);
}
curl_close($ch);
echo $result;
?>
Query parameters
| Parameter | Description | Required |
|---|---|---|
id | Id of transaction to procced. | true |
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 |