Pay to github user
curl --request POST \
--url https://api.example.com/payments/github/pay \
--header 'Content-Type: application/json' \
--data '
{
"amount": 1,
"receiver": "mesutcelik"
}
'import requests
url = "https://api.example.com/payments/github/pay"
payload = {
"amount": 1,
"receiver": "mesutcelik"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({amount: 1, receiver: 'mesutcelik'})
};
fetch('https://api.example.com/payments/github/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "<string>",
"data": {
"txn_id": 1762890982975,
"amount": 0.01,
"receipt": "https://snack.money/twitter/0xmesuthere?txn=1762890982975"
}
}{
"code": 400,
"msg": "Validation failed",
"error": null
}{
"code": 402,
"accepts": [
{
"maxAmountRequired": "1030000",
"extra": {
"name": "USD Coin",
"version": "2"
},
"scheme": "exact",
"network": "base",
"resource": "https://snack.money",
"description": "<string>",
"mimeType": "<string>",
"payTo": "0x1223d566f05Ea54E5854434C4552c9f5C2259e0f",
"maxTimeoutSeconds": 60,
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
],
"x402Version": 1,
"msg": "PAYMENT-SIGNATURE header is required"
}{
"code": 500,
"msg": "Internal server error",
"error": "Something went wrong"
}Github
Pay to github user
POST
/
payments
/
github
/
pay
Pay to github user
curl --request POST \
--url https://api.example.com/payments/github/pay \
--header 'Content-Type: application/json' \
--data '
{
"amount": 1,
"receiver": "mesutcelik"
}
'import requests
url = "https://api.example.com/payments/github/pay"
payload = {
"amount": 1,
"receiver": "mesutcelik"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({amount: 1, receiver: 'mesutcelik'})
};
fetch('https://api.example.com/payments/github/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "<string>",
"data": {
"txn_id": 1762890982975,
"amount": 0.01,
"receipt": "https://snack.money/twitter/0xmesuthere?txn=1762890982975"
}
}{
"code": 400,
"msg": "Validation failed",
"error": null
}{
"code": 402,
"accepts": [
{
"maxAmountRequired": "1030000",
"extra": {
"name": "USD Coin",
"version": "2"
},
"scheme": "exact",
"network": "base",
"resource": "https://snack.money",
"description": "<string>",
"mimeType": "<string>",
"payTo": "0x1223d566f05Ea54E5854434C4552c9f5C2259e0f",
"maxTimeoutSeconds": 60,
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
],
"x402Version": 1,
"msg": "PAYMENT-SIGNATURE header is required"
}{
"code": 500,
"msg": "Internal server error",
"error": "Something went wrong"
}Body
application/json
Required range:
0.01 <= x <= 10Example:
1
Minimum string length:
1Example:
"snackmoney"
Available options:
USDC Example:
"USDC"
Example:
"Description about the payment"
Example:
"Transaction Hash"
Show child attributes
Show child attributes
⌘I