Skip to main content
POST
/
token
/
approve
Approve ERC20 allowance (EVM)
curl --request POST \
  --url https://api.afkcrypto.com/v1/token/approve \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "chain": "<string>",
  "from": "<string>",
  "token": "<string>",
  "spender": "<string>",
  "amount": "<string>"
}'
{ "id": "tx_...", "status": "SUBMITTED", "hash": "0x..." }
{ "id": "tx_...", "status": "SUBMITTED", "hash": "0x..." }

Authorizations

x-api-key
string
header
required

Headers

Idempotency-Key
string<uuid>
required

Provide a unique Idempotency-Key per user to ensure single submission.

Body

application/json
chain
string
required

EVM chain slug.

token
string
required

ERC20 token address to approve.

spender
string
required

Spender (router) address to approve.

amount
string
required

Allowance amount in token units (uint256 string).

from
string | null

Optional sender wallet; defaults to user's default wallet for the chain.

Response

Submission accepted

id
string
required

AFK transaction id for the submitted action.

status
enum<string>
required

Submission status.

Available options:
SUBMITTED
hash
string | null
required

On-chain transaction hash/signature (may be null at submission time).

I