After sending, look up the final result and details. The SDK exposes two lookup functions:
1) By Body Hash
Use the Base64 hash of the signed message body content (payload).
import { getTonPayTransferByBodyHash } from "@ton-pay/api";
const info = await getTonPayTransferByBodyHash(bodyBase64Hash, {
chain: "mainnet",
});
2) By Reference
Use the reference returned by createTonPayTransfer.
import { getTonPayTransferByReference } from "@ton-pay/api";
const info = await getTonPayTransferByReference(reference, {
chain: "testnet",
});
Return Shape
type CompletedTonPayTransferInfo = {
amount: string;
rawAmount: string;
senderAddr: string;
recipientAddr: string;
asset: string;
assetTicker?: string;
status: string;
reference: string;
bodyBase64Hash: string;
txHash: string;
traceId: string;
commentToSender?: string;
commentToRecipient?: string;
date: string;
errorCode?: number;
errorMessage?: string;
};
Use status to drive your UI and reference/bodyBase64Hash/txHash for reconciliation.
For TON coin payments, the recipient may receive slightly less than the
requested amount because a portion is consumed by network fees (gas). If you
need an exact settlement amount, consider overpaying slightly in TON or using
a jetton where fees are paid separately in TON.
Response fields
Human-readable amount with decimals.
Amount in base units (nano for TON / jetton base units).
Recipient wallet address.
Asset address. “TON” for coin or jetton master address.
Final status: “success” or “failed”.
Tracking reference returned at creation time.
Base64 hash of the signed message body content (payload). Used for lookups.
Transaction hash assigned by the network.
Trace identifier for explorer/deep dive.
Optional note shown to the payer while signing. Public on-chain; avoid
confidential data and keep under ~120 characters to reduce gas.
Optional note shown to the payee after receipt. Public on-chain; avoid
confidential data and keep under ~120 characters to reduce gas.