Developer Guide

Submit a Merchant Rating

Submit a rating for an x402 protocol transaction without authentication.

Endpoint

POST /api/public/x402/merchant-ratings

Request Body

Field
Type
Description
Example

transactionHash

string

Blockchain transaction hash (0x + 64 hex chars)

"0x1234...abcd"

agentWalletAddress

string

Your wallet address (0x + 40 hex chars)

"0x742d...5678"

thumbsUp

boolean

Rating: true for positive, false for negative

true

resource

string

x402 resource endpoint that was called

"/api/v1/generate"

Response

Returns the created rating with a unique ID and timestamp.

Examples

Using cURL

curl -X POST https://app.frego.ai/api/public/x402/merchant-ratings \
  -H "Content-Type: application/json" \
  -d '{
    "transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "agentWalletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7",
    "thumbsUp": true,
    "resource": "/api/v1/generate"
  }'

Using Fetch (JavaScript)

Responses

Success Response (201 Created)

Error Responses

Duplicate Transaction (400 Bad Request)

Invalid Input (400 Bad Request)

Notes

  • Each transaction hash can only be rated once

  • Transaction details will be enriched asynchronously after submission

  • Merchant scores are calculated hourly based on accumulated ratings

Last updated