Check Transaction
Re-check a transaction status against the payment gateway and update local records.
POST
https://dev.mytpe.app/api/v2/mytpe-pay/links/transaction/checkQueries the payment gateway (Satim) to get the latest transaction status and updates the local transaction record accordingly.
Authentication: API Key (X-API-KEY + X-API-SECRET headers)
This API requires authentication via X-API-KEY and X-API-SECRET headers.
Request Body
Prop
Type
Example Request
const response = await fetch(
'https://dev.mytpe.app/api/v2/mytpe-pay/links/transaction/check',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'your_api_key',
'X-API-SECRET': 'your_api_secret',
},
body: JSON.stringify({
order_number: '2026010112345678',
}),
}
);
const data = await response.json();
console.log(data);interface CheckTransactionResponse {
success: boolean;
message: string;
data: {
transaction: {
id: string;
order_number: string;
status: string;
amount: string;
approval_code: string | null;
gateway_message: string | null;
environment: string;
created_at: string;
updated_at: string;
};
gateway_response: Record<string, unknown>;
};
}
const response = await fetch(
'https://dev.mytpe.app/api/v2/mytpe-pay/links/transaction/check',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'your_api_key',
'X-API-SECRET': 'your_api_secret',
},
body: JSON.stringify({
order_number: '2026010112345678',
}),
}
);
const data: CheckTransactionResponse = await response.json();
console.log(data);import requests
headers = {
'X-API-KEY': 'your_api_key',
'X-API-SECRET': 'your_api_secret',
}
response = requests.post(
'https://dev.mytpe.app/api/v2/mytpe-pay/links/transaction/check',
headers=headers,
json={
'order_number': '2026010112345678',
},
)
data = response.json()
print(data)use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'X-API-KEY' => 'your_api_key',
'X-API-SECRET' => 'your_api_secret',
])->post('https://dev.mytpe.app/api/v2/mytpe-pay/links/transaction/check', [
'order_number' => '2026010112345678',
]);
$data = $response->json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://dev.mytpe.app/api/v2/mytpe-pay/links/transaction/check',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'order_number' => '2026010112345678',
]),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-KEY: your_api_key',
'X-API-SECRET: your_api_secret',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;const axios = require('axios');
axios.post('https://dev.mytpe.app/api/v2/mytpe-pay/links/transaction/check', {
order_number: '2026010112345678',
}, {
headers: {
'X-API-KEY': 'your_api_key',
'X-API-SECRET': 'your_api_secret',
},
})
.then(response => console.log(response.data))
.catch(error => console.error(error.response?.data));Example Success Response (200 OK)
200 OK
{
"success": true,
"message": "Transaction checked successfully",
"data": {
"transaction": {
"id": "9e3f1a2b-4c5d-6e7f-8a9b-0c1d2e3f4a5b",
"transactionable_type": "App\\Models\\MytpePayLink",
"transactionable_id": "d5bb42f0-3a50-4c78-aba6-4e66ac7750af",
"order_number": "2026010112345678",
"order_id": "12345678",
"amount": "1500.00",
"status": "completed",
"environment": "production",
"approval_code": "A12345",
"gateway_message": "Approved",
"created_at": "2026-01-17T10:30:00.000000Z",
"updated_at": "2026-01-17T10:31:00.000000Z"
},
"gateway_response": {
"data": {
"attributes": {
"order_number": "2026010112345678",
"order_id": "12345678",
"amount": 1500,
"status": "paid",
"approval_code": "A12345",
"license_env": "production"
}
}
}
}
}Response Fields
Prop
Type
When to use Check Transaction
Use this endpoint to re-verify a transaction's status directly with the payment gateway. This is useful when:
- A transaction is stuck in "pending" status
- You need to confirm whether a payment was actually processed
- The initial callback/redirect was missed or failed
- You want to sync your local records with the gateway's latest data
Local Records Are Updated
When you call this endpoint, the local transaction record is automatically updated with the latest data from the gateway. This includes the status, approval_code, gateway_message, order_id, and environment fields.
Error Responses
401 Unauthorized
{
"message": "Unauthenticated."
}404 Transaction Not Found
{
"errors": [
{
"status": "404",
"code": "TRANSACTION_NOT_FOUND",
"title": "Transaction not found",
"detail": "The specified transaction does not exist"
}
]
}422 Validation Error
{
"errors": [
{
"status": "422",
"code": "VALIDATION_ERROR",
"title": "Validation failed",
"detail": "The provided data is invalid",
"meta": {
"order_number": ["The order number field is required."]
}
}
]
}