Check Transfer Status
curl --request GET \
--url https://api.example.com/api/status/:id \
--header 'API-KEY: <api-key>'import requests
url = "https://api.example.com/api/status/:id"
headers = {"API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'API-KEY': '<api-key>'}};
fetch('https://api.example.com/api/status/:id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/status/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/status/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/status/:id")
.header("API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/status/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": {
"result": {
"server_time": null,
"code": 0,
"substate": 0,
"id": "123456789",
"state": 40,
"attribute": [],
"trans": null,
"sum_prov": null,
"final": 0
}
}
}
{
"status": {
"result": {
"server_time": "2024-01-15T10:30:00Z",
"code": 0,
"substate": 0,
"id": "123456789",
"state": 60,
"attribute": [],
"trans": "TXN123456",
"sum_prov": "5.00",
"final": 1
}
}
}
{
"status": {
"result": {
"server_time": "2024-01-15T10:30:00Z",
"code": 0,
"substate": 5,
"id": "123456789",
"state": 80,
"attribute": [
{
"name": "provider-error-text",
"value": "Insufficient funds"
},
{
"name": "provider-error-code",
"value": "100"
}
],
"trans": null,
"sum_prov": null,
"final": 1
}
}
}
{
"payment_response": {
"payment_id": null,
"state": "-2",
"substate": "0",
"code": "0",
"id": "123456789"
},
"error": "",
"success": true
}
Endpoints
Check Transfer Status
Check the status of a money transfer
GET
/
api
/
status
/
:id
Check Transfer Status
curl --request GET \
--url https://api.example.com/api/status/:id \
--header 'API-KEY: <api-key>'import requests
url = "https://api.example.com/api/status/:id"
headers = {"API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'API-KEY': '<api-key>'}};
fetch('https://api.example.com/api/status/:id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/status/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/status/:id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/status/:id")
.header("API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/status/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": {
"result": {
"server_time": null,
"code": 0,
"substate": 0,
"id": "123456789",
"state": 40,
"attribute": [],
"trans": null,
"sum_prov": null,
"final": 0
}
}
}
{
"status": {
"result": {
"server_time": "2024-01-15T10:30:00Z",
"code": 0,
"substate": 0,
"id": "123456789",
"state": 60,
"attribute": [],
"trans": "TXN123456",
"sum_prov": "5.00",
"final": 1
}
}
}
{
"status": {
"result": {
"server_time": "2024-01-15T10:30:00Z",
"code": 0,
"substate": 5,
"id": "123456789",
"state": 80,
"attribute": [
{
"name": "provider-error-text",
"value": "Insufficient funds"
},
{
"name": "provider-error-code",
"value": "100"
}
],
"trans": null,
"sum_prov": null,
"final": 1
}
}
}
{
"payment_response": {
"payment_id": null,
"state": "-2",
"substate": "0",
"code": "0",
"id": "123456789"
},
"error": "",
"success": true
}
Overview
Check the current status of a money transfer using its transfer ID. This endpoint provides detailed information about the transfer state, including whether it’s completed, in progress, or encountered an error.Endpoint
GET /api/status/:id
Path Parameters
string
required
The unique money transfer ID returned when the transfer was created
Authentication
string
required
Your CashQ API Key for authentication
Request Example
curl -X GET 'https://api.cashqbot.com/api/status/123456789' \
-H 'API-KEY: your_api_key_here'
const transferId = '123456789';
const response = await fetch(
`https://api.cashqbot.com/api/status/${transferId}`,
{
method: 'GET',
headers: {
'API-KEY': 'your_api_key_here'
}
}
);
const data = await response.json();
console.log(data);
import requests
transfer_id = '123456789'
response = requests.get(
f'https://api.cashqbot.com/api/status/{transfer_id}',
headers={'API-KEY': 'your_api_key_here'}
)
data = response.json()
print(data)
<?php
$transferId = '123456789';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cashqbot.com/api/status/{$transferId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'API-KEY: your_api_key_here'
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
?>
Response
object
Status information for the transfer
Show Status properties
Show Status properties
object
Detailed transfer status information
Show Result properties
Show Result properties
string
The transfer ID
integer
General transfer status code (see Status Codes)
integer
Additional status detail code
integer
Indicates if the status is final
0: Status may change (transfer in progress)1: Status is final (transfer completed or failed)
integer
Response code
array
Additional status attributes, such as provider error information
string | null
Server timestamp
string | null
Transaction reference
string | null
Provider sum
Response Examples
{
"status": {
"result": {
"server_time": null,
"code": 0,
"substate": 0,
"id": "123456789",
"state": 40,
"attribute": [],
"trans": null,
"sum_prov": null,
"final": 0
}
}
}
{
"status": {
"result": {
"server_time": "2024-01-15T10:30:00Z",
"code": 0,
"substate": 0,
"id": "123456789",
"state": 60,
"attribute": [],
"trans": "TXN123456",
"sum_prov": "5.00",
"final": 1
}
}
}
{
"status": {
"result": {
"server_time": "2024-01-15T10:30:00Z",
"code": 0,
"substate": 5,
"id": "123456789",
"state": 80,
"attribute": [
{
"name": "provider-error-text",
"value": "Insufficient funds"
},
{
"name": "provider-error-code",
"value": "100"
}
],
"trans": null,
"sum_prov": null,
"final": 1
}
}
}
{
"payment_response": {
"payment_id": null,
"state": "-2",
"substate": "0",
"code": "0",
"id": "123456789"
},
"error": "",
"success": true
}
Understanding Transfer States
Key Status Codes
| State | Substate | Final | Description |
|---|---|---|---|
| 0 | 0-2 | No | New transfer |
| 40 | 1-3 | No | Processing |
| 60 | - | Yes | Success (completed) |
| 80 | - | Yes | Error (failed) |
| -2 | 0 | Yes | Transfer not found |
See the complete Status Codes Reference for all possible states and substates.
Final Status
Thefinal field indicates whether the transfer has reached a terminal state:
final: 0- Transfer is still in progress, status may changefinal: 1- Transfer is complete (success or failure), status won’t change
Polling Best Practices
Use exponential backoff
Use exponential backoff
Start with short intervals (1 second) and gradually increase to avoid excessive API calls.
const delay = Math.min(1000 * Math.pow(1.5, attempt), 10000);
Check the final field
Check the final field
Stop polling when
final: 1 to avoid unnecessary requests.Set a maximum timeout
Set a maximum timeout
Don’t poll indefinitely. Set a reasonable maximum number of attempts or time limit.
Handle all states
Handle all states
Account for success (state 60), failure (state 80), and not found (state -2).
Error Responses
| Error Code | Description | Solution |
|---|---|---|
authentication_error | Invalid or missing API key | Verify your API key |
transfer_not_found | Transfer ID doesn’t exist | Check the transfer ID is correct |
internal_server_error | Server error occurred | Retry the request |
Related Endpoints
Money Transfer
Create a transfer and get the ID for status checking
Status Codes
Complete reference of all status codes
