x402-facilitator-go

This is a deployed instance of the x402-facilitator-go service brought to you by Raid Guild.

You can use this service to verify and settle payments for x402 transactions.

API Key

Depending on the configuration, you may need to provide an API key to access the API endpoints.

If this instance requires an API key, you will need to include the API key in the X-API-Key header.

API Endpoints

Verify Examples

An example request to the /verify endpoint (with API key):

curl -X POST verify \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "x402Version": 2, "paymentPayload": { "accepted": { "scheme": "exact", "network": "eip155:11155111" }, "payload": { "authorization": { "from": "0x354b5cBeEaE7751f2055BfC2d9d78556aD2E1c61", "to": "0x9a4e1A0BC77639Fdce69df88E1DF1D589e454811", "value": "1000", "validAfter": "1767140522", "validBefore": "1767141422", "nonce": "0x2454c8d9065ebdffd65226693448da75f3c1227fec5ed9c3d0043892cd593f84" }, "signature": "0xdf3cac4be24a317e07b4374b5f1198fc9760c9849fe80f1383755c2d541c4e042b7b9f79aee3b67c236130127299609998a4b31be154963091dd1920a374b0201b" } }, "paymentRequirements": { "scheme": "exact", "network": "eip155:11155111", "asset": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", "payTo": "0x9a4e1A0BC77639Fdce69df88E1DF1D589e454811", "amount": "1000", "maxTimeoutSeconds": 300, "extra": { "name": "USDC", "version": "2" } } }'

An example response from the /verify endpoint (200 OK - valid):

{ "scheme": "exact", "network": "eip155:11155111", "isValid": true, "payer": "0x354b5cBeEaE7751f2055BfC2d9d78556aD2E1c61" }

An example response from the /verify endpoint (200 OK - invalid):

{ "scheme": "exact", "network": "eip155:11155111", "isValid": false, "invalidReason": "invalid_authorization_signature" }

An example response from the /verify endpoint (401 Unauthorized):

unauthorized

An example response from the /verify endpoint (400 Bad Request):

invalid character 'x' looking for beginning of value

An example response from the /verify endpoint (500 Internal Server Error):

failed to get token balance

Settle Examples

An example request to the /settle endpoint (with API key):

curl -X POST settle \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "x402Version": 2, "paymentPayload": { "accepted": { "scheme": "exact", "network": "eip155:11155111" }, "payload": { "authorization": { "from": "0x354b5cBeEaE7751f2055BfC2d9d78556aD2E1c61", "to": "0x9a4e1A0BC77639Fdce69df88E1DF1D589e454811", "value": "1000", "validAfter": "1767140522", "validBefore": "1767141422", "nonce": "0x2454c8d9065ebdffd65226693448da75f3c1227fec5ed9c3d0043892cd593f84" }, "signature": "0xdf3cac4be24a317e07b4374b5f1198fc9760c9849fe80f1383755c2d541c4e042b7b9f79aee3b67c236130127299609998a4b31be154963091dd1920a374b0201b" } }, "paymentRequirements": { "scheme": "exact", "network": "eip155:11155111", "asset": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", "payTo": "0x9a4e1A0BC77639Fdce69df88E1DF1D589e454811", "amount": "1000", "maxTimeoutSeconds": 300, "extra": { "name": "USDC", "version": "2" } } }'

An example response from the /settle endpoint (200 OK - success):

{ "scheme": "exact", "network": "eip155:11155111", "success": true, "transaction": "0xb6b3f3770f2a24ab064a0801922616886acd9058ace6a29be00bdf1d7b8289b6" }

An example response from the /settle endpoint (200 OK - failed):

{ "scheme": "exact", "network": "eip155:11155111", "success": false, "errorReason": "invalid_authorization_signature" }

An example response from the /settle endpoint (401 Unauthorized):

unauthorized

An example response from the /settle endpoint (400 Bad Request):

invalid character 'x' looking for beginning of value

An example response from the /settle endpoint (500 Internal Server Error):

failed to send transaction

Supported Examples

An example request to the /supported endpoint:

curl -X GET supported

An example response from the /supported endpoint:

{ "kinds": [ { "x402Version": 1, "scheme": "exact", "network": "sepolia" }, { "x402Version": 2, "scheme": "exact", "network": "eip155:11155111" } ] }

More Information

To learn more about this service, please see the x402-facilitator-go repository.