Payments
Two endpoints, called in order. Both follow x402: call once to get the terms, sign, then call again with the payment.
| Method | POST |
| Body | { "pressId": 322 } |
| Payment header | payment-signature (the x-payment header is also accepted) |
| Token | USDG on Robinhood Chain |
Pay the platform fee
POST /api/pay/treasuryCharges 10% of the press's priceUnits, rounded down, to the treasury.
Without a payment → 402 with the terms.
With a valid payment → 200
{ "paid": true, "tx": "0x…" }If this wallet already paid the fee for this press, the payment is not settled again:
{ "paid": true, "tx": "0x…", "already": true }Pay the publisher
POST /api/pay/publisherCharges the remaining 90% to the wallet that currently owns the press NFT, read from the chain at request time.
With a valid payment → 200
{ "paid": true, "tx": "0x…", "body": "The full text of the press…" }The response also sets a session cookie for the paying wallet, so a browser can read the press again later without paying.
| Status | When |
|---|---|
409 "Pay the platform fee first." | No fee payment is recorded for this wallet and press |
409 "You've already unlocked this press." | This wallet already bought it. Nothing is charged |
Headers
| Header | Direction | Content |
|---|---|---|
payment-required | Response, on 402 | Base64 JSON of the terms (same as the body) |
payment-signature | Request | Base64 JSON of the signed payment |
payment-response | Response, on 200 | Base64 JSON receipt: { success, transaction, network, payer } |
What the server checks
Before settling anything, the signed terms must match what the server charges right now: same network, token, amount and recipient. A payment signed for a lower amount or a different recipient is refused with a fresh 402.
Settlement happens before the response. When you get 200, the USDG has already moved onchain, and tx is the transaction.
Errors
See the response table in the payment guide.
