x402
x402 copied to clipboard
x402.org /protected returns a json object in the error field
When calling https://www.x402.org/protected with an invalid payment, according to the specs, the error field should contain an error message (Optional error message indicating why payment is required) but I'm getting a JSON object:
"error": {
"issues": [
{
"code": "invalid_union",
"unionErrors": [
{
"issues": [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"payload",
"signature"
],
"message": "Required"
}
],
"name": "ZodError"
},
{
"issues": [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"payload",
"transaction"
],
"message": "Required"
}
],
"name": "ZodError"
}
],
"path": [
"payload"
],
"message": "Invalid input"
}
],
"name": "ZodError"
}
I don't see anything about it in the specs, documentation or the code. Is it part of the specs ?
I'm using https://www.x402.org/protected to develop an x402 java sdk, that's why I'm testing all replies to be sure I reply the same way than you do.