Get Payment Status
GET /api/payments/{invoice_id}/status
Verify a payment server-to-server and get its real status. If the payment was paid but not credited yet, this call credits it (never twice).
It asks the payment gateway each time, so it usually answers within a second or two but can take up to about a minute when the gateway is slow — set your HTTP client’s timeout to at least 70 seconds.
Request Example
Section titled “Request Example”curl -X GET https://api.awajdigital.com/api/payments/17941438309537516/status \ -H "Authorization: Bearer your_api_token_here" \ -H "Accept: application/json"// Browser JavaScript (Fetch API)const response = await fetch('https://api.awajdigital.com/api/payments/17941438309537516/status', { method: 'GET', headers: { 'Authorization': 'Bearer your_api_token_here', 'Accept': 'application/json' }});
const data = await response.json();console.log(data);// Node.js with axiosconst axios = require('axios');
async function getPaymentStatus() { try { const response = await axios.get('https://api.awajdigital.com/api/payments/17941438309537516/status', { headers: { 'Authorization': 'Bearer your_api_token_here', 'Accept': 'application/json' } });
console.log(response.data); } catch (error) { console.error('Error:', error.response?.data || error.message); }}
getPaymentStatus();# Python with requestsimport requests
def get_payment_status(): url = 'https://api.awajdigital.com/api/payments/17941438309537516/status' headers = { 'Authorization': 'Bearer your_api_token_here', 'Accept': 'application/json' }
try: response = requests.get(url, headers=headers) print(response.json()) except requests.exceptions.RequestException as e: print(f'Error: {e}')
get_payment_status()<?php// PHP with cURL$url = 'https://api.awajdigital.com/api/payments/17941438309537516/status';$token = 'your_api_token_here';
$ch = curl_init($url);curl_setopt($ch, CURLOPT_HTTPGET, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: Bearer ' . $token, 'Accept: application/json']);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);curl_close($ch);
$result = json_decode($response, true);print_r($result);?>Success Response Example
Section titled “Success Response Example”{ "success": true, "invoice_id": "17941438309537516", "status": "completed", "amount": 500}| status | Meaning |
|---|---|
| completed | Payment confirmed and balance credited |
| pending | Not paid (yet) — still open, failed or cancelled |
| unknown | Only for payments made before November 2026 that were never completed |
Error Responses
Section titled “Error Responses”| Status | Description |
|---|---|
| 401 | Missing or invalid access token |
| 404 | Payment not found or not owned by your account |
| 502 | Could not reach the payment gateway — try again |
