You can get invoice-unique-id and orderId with GET method in your website callback URL
ENDPOINT https://app.paycrypto24.com/api/gateway/request/check/{invoice-unique-id}/{orrderId}
the following parameters that you will receive in your callback URL
NAME | DEFINITION |
---|---|
uuid | Invoice unique ID |
order_id | Your website invoice ID |
All requests must be sent via GET method in JSON format.
Here are some examples of how to communicate with the API:
Example of making request in Javascript:
fetch('https://app.paycrypto24.com/api/gateway/request/check/{invoice-unique-id}/{orderId}', {
method: "GET",
headers: {
"Authorization": "Bearer 3|fy5JH4a8 ********** 1C9958f1f1",
"Accept": "application/json",
"Content-Type": "application/json"
},
})
Example of making request in Laravel client:http package:
use Illuminate\Support\Facades\Http;
$url = "https://app.paycrypto24.com/api/gateway/request/check/{invoice-unique-id}/{orderId}";
$token = "your_bearer_token_here"; // Replace with your actual token
$response = Http::withToken($token)
->acceptJson();
->get();
if ($response->successful()) {
return $response->json(); // Return or process the response data
} else {
return response()->json([
'error' => 'Request failed',
'status' => $response->status(),
'message' => $response->body(),
], $response->status());
}
Example of making request with CURL:
curl -X GET https://app.paycrypto24.com/api/gateway/request/check/{invoice-unique-id}/{orderId} -H "Authorization: Bearer your_bearer_token_here" -H "Accept: application/json" -H "Content-Type: application/json"
Here are some examples of endpoint response types:
DATA | STATUS | CODE |
---|---|---|
`Payment TXID` | true | 200 |
Invoice status | `pending` - `pending_currency` - `pending_payment` - `expired` - `replaced` | false | 200 |
`invoice not found` | false | 404 |
`Unauthenticated.` | - | 401 |
Example of responses with json format:
{
"status": true,
"data": {
"txid": "0xbd0d23b20999e15788c5********5793a23c"
}
}
{
"status": true,
"data": "expired" // the invoice current status | example : pending - pending_currency - pending_payment - expired - replaced
}
{
"status": false,
"data": "not_found" // invoice not found
}
{
"message": "Unauthenticated." // invalid API key
}