Quote the request
The gateway returns amount, receiver, asset id, memo, expiry, and resource scope.
Hedera-native HTTP 402
A protected route returns a payment challenge. The client sends an HBAR or HTS transfer, retries with a proof, and the server verifies settlement through Mirror Node before releasing data.
$ curl -i https://hedera-pay-402-live.iaped.in/api/protected/market-signal
HTTP/2 402
PAYMENT-REQUIRED: eyJ4NDAy...
{
"paymentRequired": true,
"challenge": {
"network": "hedera:testnet",
"assetId": "0.0.0",
"amount": "250000"
}
}
Live endpoint
The deployed server protects one demo route. Without a `PAYMENT-SIGNATURE` proof it returns HTTP 402 and a base64url invoice in `PAYMENT-REQUIRED`.
Protocol
The gateway returns amount, receiver, asset id, memo, expiry, and resource scope.
The client submits an HBAR or HTS transfer. The invoice id is carried in the transaction memo.
The server checks result, amount, receiver, token id, memo, timestamp, and replay status before returning data.
Server contract
This is a running Node server, not a static mock. Tests cover challenge creation, invoice lookup, Mirror Node transaction verification, underpayment rejection, wrong memo rejection, expiry, and replay protection.