Create a Coinbase charge for crypto payment
POST
https://novapai.ai/api/v1/credits/coinbase
POST
/api/v1/credits/coinbase
cURL
$curl -X POST https://novapai.ai/api/v1/credits/coinbase \
>-H "Authorization: Bearer <token>" \
>-H "Content-Type: application/json" \
>-d '\{
>"amount": 150,
>"sender": "0xAbC1234567890DefABC1234567890dEfABC12345",
>"chain_id": 1
>\}'200 Successful
reference-credits-create-coinbase-charge-01.json
{
"data": {
"id": "charge_01F8MECHZX3TBDSZ7XRADM79XV",
"created_at": "2024-06-01T12:00:00Z",
"expires_at": "2024-06-01T12:30:00Z",
"web3_data": {
"transfer_intent": {
"call_data": {
"deadline": "2024-06-01T12:25:00Z",
"fee_amount": "0.0005",
"id": "tx_0x9f8b7c6d5e4a3b2c1d0e",
"operator": "0xOperator1234567890abcdef1234567890abcdef",
"prefix": "0x",
"recipient": "0xRecipient0987654321fedcba0987654321fedcba",
"recipient_amount": "150.00",
"recipient_currency": "USDC",
"refund_destination": "0xRefund1234567890abcdef1234567890abcdef",
"signature": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
},
"metadata": {
"chain_id": 1,
"contract_address": "0xContract1234567890abcdef1234567890abcdef",
"sender": "0xAbC1234567890DefABC1234567890dEfABC12345"
}
}
}
}
}Create a Coinbase charge for crypto payment
Authentication
Authorization Bearer
API key as bearer token in Authorization header
Request
This endpoint expects an object.
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| amount | double | 是 | - |
| sender | string | 是 | - |
| chain_id | enum | 是 | Allowed values:1 137 8453 |
Response
Returns the calldata to fulfill the transaction
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| data | object | - | - |
Errors
| 状态码 | 说明 |
|---|---|
| 400 | Bad Request Error |
| 401 | Unauthorized Error |
| 429 | Too Many Requests Error |
| 500 | Internal Server Error |