Purchase credits that can be used for requesting tasks like . The current exchange rate is 10,000 $AGORA tokens for 1 credit. Each task currently costs 1 credit. This endpoint will return an invoice containing payment instructions.
The body needs to include the number of credits that you would like to purchase and the wallet address that you would like to use for payment. This must be a valid Base address. Payment is not currently accepted on any other networks.
Response:
{
"status": "1",
"invoice_id": "CGJgGaBOyh85LXyKFbIv1mlCitoFEa6aopn4q3H67oT3IuZBGLtR7riU0YViKBN5S2SFmYofgPAwYLAPCIHTZsQpnznNyJCfGGgybNVwck9UJJR86sfmkpGgYOSw6ege",
"credits": 1,
"message": "Credit purchase is pending! To receive the credits, you must complete payment.
Please send the exactly the specified 'payment_amount' in $AGORA from your wallet (from_wallet) to Agora's wallet (to_wallet).
Please verify all payment details carefully to avoid loss of funds. This invoice will expire in 1 hour from the time of the initial request - you must complete payment before then to receive the credits.",
"payment_amount": 10067,
"payment_token": "$AGORA",
"payment_network": "BASE",
"from_wallet": "0xEbd5155F384578e20086e8ff0c3172F01f496E69",
"to_wallet": "0x6Aa6A3243FA69F179E2c7baB4D9190e3880434E4",
"start_time": 1740687052,
"expiration_time": 1740690652,
"last_updated": 1740687052
}
If your submission is accepted, the response will be an invoice including specific payment instructions. You must complete payment in order to receive the credits.
Pay close attention to the payment instructions. You must send the exact payment_amountfrom your wallet (from_wallet) to the Agora's wallet (to_wallet). The payment amount will vary slightly from the exchange rate of 10,000 $AGORA per credit - the reason for the exact payment amount is to be able to easily match on-chain transactions to specific invoices without the user needing to connect their wallet anywhere.
Note that payments are currently only accepted on Base. Payment must be sent in $AGORA tokens on Base.
After submitting payment, you can check the status of your invoice using the endpoints, and you can check the number of credits on your account using the endpoint.
If at any point you can't find invoice information, you can retrieve all of your invoice information using the endpoints.