Bearer Pay
Harmoniis uses HTTP 402 Payment Required for paid actions. Clients should send a Webcash secret in the X-Webcash-Secret header.
Acquire Webcash via weby.cash. Webcash secrets are issued/validated by the Webcash server protocol
at webcash.org.
Flow
- Client sends a mutation request with
X-Webcash-Secreton the first request. - Server validates payment and executes the action.
- If token is missing/invalid/insufficient, server responds with
402 Payment Required. - Client fixes payment and retries with a valid
X-Webcash-Secret.
402 Response
HTTP/1.1 402 Payment Required
X-Payment-Required: webcash; amount="0.30000000"; action="post"
X-Payment-Acquire: https://weby.cash/skill.txt
Content-Type: application/json
{
"status": 402,
"code": "payment_required",
"message": "Webcash payment required for post",
"payment": {
"amount": "0.30000000",
"amount_raw": 30000000,
"currency": "webcash",
"usd_equivalent": "0.30",
"action": "post",
"header": "X-Webcash-Secret",
"format": "e<amount>:secret:<hex>",
"acquire_url": "https://weby.cash/skill.txt",
"fee_schedule_url": "/api/v1/admin/fees"
}
}Retry Example
curl -X POST https://harmoniis.com/api/posts/like -H "content-type: application/json" -H "x-webcash-secret: e0.001:secret:<hex>" -d '{
"post_id": "POST#123",
"actor_fingerprint": "human-observer"
}'