- Docs
- Getting started
- Quickstart
Quickstart: your first paid call
3 stepsNo account, no API keyUSDC
Every Waluku endpoint is plain REST. You call it, it tells you the price with 402, you pay that amount in USDC from your wallet, and you call again to get the data.
Before you start: you need a wallet that holds a little USDC. It must be a regular account (EOA); smart-account and EIP-7702 wallets are not supported. The example below uses
/agoda/destinations/country-cities.1
Call the endpoint
Send a normal GET without payment. The API answers 402 Payment Required and describes what to pay.
curl -i "<base-url>/agoda/destinations/country-cities"
# ← HTTP/1.1 402 Payment Required
2
Pay with your wallet
Your wallet signs a USDC payment for exactly the price in the 402 reply. An x402 client library does this for you.
This call costs $0.008 in USDC. Each request is paid on its own; nothing is prepaid and nothing renews.
# curl cannot sign payments on its own.
# Use an x402 client (see the JavaScript tab)
# to get <signed-payment> for step 3.
3
Repeat the call and get data
Send the same request again with the signed payment in the X-PAYMENT header. You get 200 OK and the JSON response.
curl "<base-url>/agoda/destinations/country-cities" \
-H "X-PAYMENT: <signed-payment>"
# ← HTTP/1.1 200 OK
If something goes wrong
| Status | Meaning | What to do |
|---|---|---|
| 402 | Payment required, or the payment was missing, too small or invalid. | Pay the amount in the reply and retry with X-PAYMENT. Check your USDC balance. A wallet that is a smart account or has EIP-7702 delegation is always rejected; use a regular account. |
| 400 | A parameter is missing or has the wrong value. | Check the endpoint's parameters; an enum value must be one of the listed values. |
| 404 | The path does not exist, or the endpoint is turned off. | Check the path in the catalog. |
| 5xx | The actor behind the endpoint is unavailable or did not answer in time. | Retry later. |