Get Payment Status
curl --request GET \
--url https://api.example.com/payments/status/{id}import requests
url = "https://api.example.com/payments/status/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/payments/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/payments/status/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/payments/status/{id}"
req, _ := http.NewRequest("GET", url, nil)
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/payments/status/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/payments/status/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Payment not found"
}
]
}
Payments
Get Payment Status
Retrieve the current status of a payment transaction
GET
/
payments
/
status
/
{id}
Get Payment Status
curl --request GET \
--url https://api.example.com/payments/status/{id}import requests
url = "https://api.example.com/payments/status/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/payments/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/payments/status/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/payments/status/{id}"
req, _ := http.NewRequest("GET", url, nil)
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/payments/status/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/payments/status/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Payment not found"
}
]
}
Endpoint
GET https://api.digitzs.com/payments/status/{id}
Overview
Use this lightweight endpoint to quickly check the status of a payment transaction without retrieving all transaction details.This endpoint returns less data than GET /payments/, making it ideal for status polling or when you only need to know if a payment succeeded.
Authentication
| Header | Value | Required |
|---|---|---|
x-api-key | Your API key | Yes |
Authorization | Bearer {appToken} | Yes |
appId | Your application ID | Yes |
Path Parameters
string
required
The unique payment transaction ID
Response
Success Response (200 OK)
{
"links": {
"self": "https://api.digitzs.com/payments/status/pay_abc123xyz"
},
"data": {
"type": "payments",
"id": "pay_abc123xyz",
"attributes": {
"status": "completed",
"paymentType": "card",
"amount": "2500",
"currency": "USD",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:05Z"
}
}
}
string
Current payment status:
pending, completed, failed, refunded, voided, or partial_refundstring
Transaction amount in cents
string
ISO 8601 timestamp of payment creation
string
ISO 8601 timestamp of last status update
Code Examples
curl -X GET https://api.digitzs.com/payments/status/pay_abc123xyz \
-H "x-api-key: your-api-key" \
-H "Authorization: Bearer your-app-token" \
-H "appId: your-app-id"
const axios = require('axios');
async function getPaymentStatus(paymentId) {
const response = await axios.get(
`https://api.digitzs.com/payments/status/${paymentId}`,
{
headers: {
'x-api-key': 'your-api-key',
'Authorization': 'Bearer your-app-token',
'appId': 'your-app-id'
}
}
);
const status = response.data.data.attributes.status;
console.log(`Payment ${paymentId} status:`, status);
return status;
}
getPaymentStatus('pay_abc123xyz');
import requests
def get_payment_status(payment_id):
url = f"https://api.digitzs.com/payments/status/{payment_id}"
headers = {
"x-api-key": "your-api-key",
"Authorization": "Bearer your-app-token",
"appId": "your-app-id"
}
response = requests.get(url, headers=headers)
response.raise_for_status()
status = response.json()["data"]["attributes"]["status"]
print(f"Payment {payment_id} status: {status}")
return status
get_payment_status("pay_abc123xyz")
<?php
function getPaymentStatus($paymentId) {
$url = "https://api.digitzs.com/payments/status/" . $paymentId;
$headers = [
"x-api-key: your-api-key",
"Authorization: Bearer your-app-token",
"appId: your-app-id"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
$status = $data["data"]["attributes"]["status"];
echo "Payment status: $status\n";
return $status;
}
getPaymentStatus("pay_abc123xyz");
?>
require 'net/http'
require 'json'
def get_payment_status(payment_id)
uri = URI("https://api.digitzs.com/payments/status/#{payment_id}")
request = Net::HTTP::Get.new(uri)
request['x-api-key'] = 'your-api-key'
request['Authorization'] = 'Bearer your-app-token'
request['appId'] = 'your-app-id'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
data = JSON.parse(response.body)
status = data['data']['attributes']['status']
puts "Payment status: #{status}"
status
end
get_payment_status('pay_abc123xyz')
Status Values
| Status | Description | Next Actions |
|---|---|---|
pending | Payment processing (typical for ACH) | Wait for settlement |
completed | Successfully processed | No action needed |
failed | Payment failed or declined | Review error, retry with different payment method |
refunded | Fully refunded | No further refunds possible |
voided | Transaction cancelled same-day | No action needed |
partial_refund | Partially refunded | Additional refunds possible up to remaining amount |
Polling Best Practices
ACH Payment Polling
ACH Payment Polling
Frequency: Check every 30-60 minutes during business hoursDuration: ACH payments take 3-5 business days to settleBetter Alternative: Implement webhooks for real-time status updates
Card Payment Status
Card Payment Status
Frequency: Check once immediately after creation, then hourly if neededDuration: Card payments typically complete within secondsTimeout: If pending after 5 minutes, likely an issue - investigate
Exponential Backoff
Exponential Backoff
For repeated status checks:
- First check: Immediate
- Second check: 30 seconds
- Third check: 1 minute
- Fourth check: 2 minutes
- Continue doubling up to maximum interval
Error Responses
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Payment not found"
}
]
}
Common Use Cases
- Status Polling: Regularly check ACH payment status until settled
- Payment Confirmation: Verify payment completed before fulfilling orders
- Dashboard Updates: Display real-time payment status in admin interfaces
- Webhook Verification: Confirm status received via webhook matches current state
Performance Considerations
Lighter Payload: This endpoint returns significantly less data than GET /payments/, making it faster and more efficient for status checks.
Rate Limiting: Avoid excessive polling. Implement reasonable intervals or use webhooks instead.
Next Steps
Get Full Payment Details
Retrieve complete payment information including fees and splits
List Payments
View all payments for a merchant

