Get Payment by ID
curl --request GET \
--url https://api.example.com/payments/{id}import requests
url = "https://api.example.com/payments/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/payments/{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/{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/{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/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/payments/{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"
}
]
}
{
"errors": [
{
"status": "403",
"title": "Forbidden",
"detail": "Not authorized to access this payment"
}
]
}
Payments
Get Payment by ID
Retrieve detailed information about a specific payment transaction
GET
/
payments
/
{id}
Get Payment by ID
curl --request GET \
--url https://api.example.com/payments/{id}import requests
url = "https://api.example.com/payments/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/payments/{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/{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/{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/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/payments/{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"
}
]
}
{
"errors": [
{
"status": "403",
"title": "Forbidden",
"detail": "Not authorized to access this payment"
}
]
}
Endpoint
GET https://api.digitzs.com/payments/{id}
Overview
Use this endpoint to retrieve complete details of a specific payment transaction, including transaction status, amounts, fees, and any associated split information.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)
object
Container for payment data
Show properties
Show properties
string
Resource type -
"payments"string
Payment transaction ID
object
Show Payment attributes
Show Payment attributes
string
Type of payment (e.g., “card”, “ACH”)
string
Merchant account identifier
string
ISO 8601 timestamp of when payment was created
string
Payment status (pending, completed, failed, refunded, voided)
object
Show Transaction details
Show Transaction details
string
Response code from processor
string
Transaction status message
string
Transaction amount in cents
string
Currency code
string
Invoice reference number
string
Authorization code (card payments)
string
AVS verification result (card payments)
string
Gross transaction amount
string
Net amount after fees
string
Fixed processing fee
string
Percentage rate applied
Example Response - Card Payment
{
"links": {
"self": "https://api.digitzs.com/payments/pay_abc123xyz"
},
"data": {
"type": "payments",
"id": "pay_abc123xyz",
"attributes": {
"paymentType": "card",
"merchantId": "merchant_123456",
"createdAt": "2024-01-15T10:30:00Z",
"status": "completed",
"transaction": {
"code": "0",
"message": "Success",
"amount": "2500",
"currency": "USD",
"invoice": "INV-2024-001",
"authCode": "A11111",
"avsResult": "Y",
"gross": "2500",
"net": "2399",
"grossMinusNet": "101",
"fee": "30",
"rate": "2.90"
}
}
}
}
Example Response - Split Payment
{
"links": {
"self": "https://api.digitzs.com/payments/pay_split_abc123"
},
"data": {
"type": "payments",
"id": "pay_split_abc123",
"attributes": {
"paymentType": "card",
"merchantId": "merchant_primary_123",
"status": "completed",
"transaction": {
"amount": "500",
"gross": "500",
"net": "365",
"invoice": "INV-2024-002"
},
"splits": [
{
"merchantId": "merchant_platform_456",
"amount": "100",
"status": "completed"
}
]
}
}
}
Example Response - ACH Payment
{
"data": {
"type": "payments",
"id": "pay_ach_xyz789",
"attributes": {
"paymentType": "ACH",
"merchantId": "merchant_123456",
"status": "pending",
"transaction": {
"code": "0",
"message": "Pending",
"amount": "3635",
"currency": "USD",
"invoice": "INV-ACH-001"
},
"bank": {
"accountType": "checking",
"last4": "7890"
}
}
}
}
Code Examples
curl -X GET https://api.digitzs.com/payments/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 getPayment(paymentId) {
const response = await axios.get(
`https://api.digitzs.com/payments/${paymentId}`,
{
headers: {
'x-api-key': 'your-api-key',
'Authorization': 'Bearer your-app-token',
'appId': 'your-app-id'
}
}
);
console.log('Payment Status:', response.data.data.attributes.status);
console.log('Amount:', response.data.data.attributes.transaction.amount);
return response.data;
}
getPayment('pay_abc123xyz');
import requests
def get_payment(payment_id):
url = f"https://api.digitzs.com/payments/{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()
data = response.json()["data"]
print(f"Status: {data['attributes']['status']}")
print(f"Amount: ${float(data['attributes']['transaction']['amount'])/100:.2f}")
return response.json()
get_payment("pay_abc123xyz")
<?php
function getPayment($paymentId) {
$url = "https://api.digitzs.com/payments/" . $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);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$data = json_decode($response, true);
echo "Status: " . $data["data"]["attributes"]["status"] . "\n";
echo "Amount: $" . ($data["data"]["attributes"]["transaction"]["amount"] / 100) . "\n";
return $data;
} else {
throw new Exception("Error: " . $response);
}
}
getPayment("pay_abc123xyz");
?>
require 'net/http'
require 'json'
require 'uri'
def get_payment(payment_id)
uri = URI("https://api.digitzs.com/payments/#{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
if response.code == '200'
data = JSON.parse(response.body)['data']
puts "Status: #{data['attributes']['status']}"
puts "Amount: $#{data['attributes']['transaction']['amount'].to_f / 100}"
JSON.parse(response.body)
else
raise "Error: #{response.body}"
end
end
get_payment('pay_abc123xyz')
Payment Status Values
| Status | Description |
|---|---|
pending | Payment is being processed (common for ACH) |
completed | Payment successfully processed and settled |
failed | Payment failed or was declined |
refunded | Payment has been refunded |
voided | Payment was voided (same-day cancellation) |
partial_refund | Payment has been partially refunded |
Error Responses
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Payment not found"
}
]
}
{
"errors": [
{
"status": "403",
"title": "Forbidden",
"detail": "Not authorized to access this payment"
}
]
}
Use Cases
Transaction Reconciliation
Transaction Reconciliation
Use this endpoint to verify transaction details match your records and reconcile payments with your accounting system.
Customer Support
Customer Support
Retrieve payment details when customers inquire about their transactions or report issues.
Refund Processing
Refund Processing
Check payment status and amount before processing refunds to ensure accuracy.
Split Payment Tracking
Split Payment Tracking
Monitor distribution of split payments across multiple merchant accounts.
Best Practices
- Cache Appropriately: Cache payment details but refresh for status updates
- Handle ACH Delays: ACH payments remain “pending” for 3-5 business days
- Monitor Split Details: For split payments, verify amounts distributed correctly
- Store Payment IDs: Always save payment IDs for future reference and support
- Use Webhooks: Consider implementing webhooks for real-time status updates instead of polling
Next Steps
Get Payment Status
Check only the status of a payment (lighter endpoint)
List Payments
Retrieve multiple payments for a merchant

