Get payment status
Poll this to check a payment’s status. In most integrations the completion webhook arrives before you’d need to poll — use this for a manual status check or to recover from a missed webhook delivery.
Request
Section titled “Request”curl -s https://api.sendchain.example/v1/store-api/payments/$PAYMENT_ID \ -u "$API_KEY:$SECRET_KEY"const res = await fetch(`https://api.sendchain.example/v1/store-api/payments/${paymentId}`, { headers: { "Authorization": "Basic " + Buffer.from(`${API_KEY}:${SECRET_KEY}`).toString("base64"), },});
if (res.status === 404) { throw new Error("unknown payment id");}
const { id, status, confirmations } = await res.json();import requests
response = requests.get( f"https://api.sendchain.example/v1/store-api/payments/{payment_id}", auth=(API_KEY, SECRET_KEY),)if response.status_code == 404: raise ValueError("unknown payment id")
status = response.json()<?php$ch = curl_init("https://api.sendchain.example/v1/store-api/payments/{$paymentId}");curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_USERPWD => "$apiKey:$secretKey",]);
$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);curl_close($ch);
if ($status === 404) { throw new Exception("unknown payment id");}
$payment = json_decode($response, true);Response — 200 OK
Section titled “Response — 200 OK”{ "id": "pay_...", "status": "confirmed", "confirmations": 3 }| Field | Type | Description |
|---|---|---|
id |
string | |
status |
string | awaiting_payment, detected, confirmed, completed, partial, overpaid, reversed, or expired. |
confirmations |
integer | Present once a matching transaction is detected on-chain. |
Errors
Section titled “Errors”| Status | error |
Meaning |
|---|---|---|
| 401 | invalid_credentials |
Missing, malformed, or mismatched Basic auth. |
| 404 | not_found |
The id doesn’t belong to your store (never distinguishes “doesn’t exist” from “someone else’s”). |