NavenDocs
NavenDocs
Introduction
WalletQuickstartx402 PaymentsAuthenticationAPI Reference
Back to Naven Network
Wallet

API Reference

Wallet provisioning, x402 payment, lookup, and credential endpoints.

Base URL

https://api.naven.network

All responses use the same envelope:

{
  "code": 0,
  "message": "ok",
  "data": {}
}

Error responses use a non-zero code and may include validation details in data.

Wallet object

FieldTypeDescription
idstringNaven wallet ID
externalIdstringStable identifier supplied by your application
namestringDisplay name
providerstringWallet provider; currently privy
addressstring or nullOn-chain address
chainTypestringethereum
statusstringprovisioning, active, or failed
metadataobject or nullCaller-defined scalar metadata
lastErrorstring or nullMost recent provisioning failure
createdAtISO 8601 stringCreation time
updatedAtISO 8601 stringLast update time

List wallets

GET /v1/wallets
Authorization: Bearer naven_api_...

Returns wallet objects ordered from newest to oldest.

Create a wallet

POST /v1/wallets
Authorization: Bearer naven_api_...
Content-Type: application/json

Request body:

FieldRequiredDescription
externalIdyesStable caller-defined ID, 1–200 characters
nameyesDisplay name, 1–200 characters
chainTypenoethereum; defaults to ethereum
metadatanoString-keyed object with string, number, or boolean values

The first successful request returns 201 Created, the wallet, and a one-time default wallet credential. Reusing an active wallet's externalId returns 200 OK, created: false, and no credential.

An externalId cannot be reused with a different chainType.

Get a wallet

GET /v1/wallets/:walletId
Authorization: Bearer naven_api_...

Returns 404 Not Found when the wallet does not exist or does not belong to your API credential.

List wallet credentials

GET /v1/wallets/:walletId/credentials
Authorization: Bearer naven_api_...

Returns credential metadata. Full secrets are never included.

Create a wallet credential

POST /v1/wallets/:walletId/credentials
Authorization: Bearer naven_api_...
Content-Type: application/json

Request body:

FieldRequiredDescription
nameyesCredential name, 1–100 characters
expiresAtnoISO 8601 expiration timestamp

Returns 201 Created. The response includes the full secret exactly once. The wallet must be active.

Revoke a wallet credential

DELETE /v1/wallets/:walletId/credentials/:credentialId
Authorization: Bearer naven_api_...

Marks the credential as revoked and returns its updated metadata.

Resolve the current wallet

GET /v1/wallets/me
Authorization: Bearer naven_wallet_...

Returns the wallet and metadata for the wallet credential used in the request. This endpoint does not accept the management API credential.

Pay and call an x402 resource

POST /v1/wallets/me/pay-and-call
Authorization: Bearer naven_wallet_...
Content-Type: application/json

Request body:

FieldRequiredDescription
urlyesPublic HTTPS x402 resource URL
methodnoGET, POST, PUT, PATCH, or DELETE; defaults to GET
headersnoUp to 50 headers forwarded to the upstream resource
bodynoString or JSON body; not allowed with GET
maxPayment.networkyesExpected EVM CAIP-2 network such as eip155:8453
maxPayment.assetyesExpected ERC-20 token contract address
maxPayment.amountyesMaximum payment in atomic token units

The endpoint supports x402 version 2 and the exact EVM scheme. It makes an initial upstream request and pays only when all returned payment requirements match maxPayment.

The response contains:

{
  "code": 0,
  "message": "ok",
  "data": {
    "upstream": {
      "status": 200,
      "headers": {
        "content-type": "application/json"
      },
      "body": {}
    },
    "payment": {
      "id": "4c317dea-a052-4e83-9760-e3ac1cb35350",
      "status": "settled",
      "x402Version": 2,
      "network": "eip155:4663",
      "asset": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
      "amount": "100",
      "payTo": "0x...",
      "transaction": "0x...",
      "settlement": {}
    }
  }
}

payment is null when the upstream resource does not require payment. Binary response bodies are returned as base64.

Status codes

StatusMeaning
200Read succeeded, idempotent wallet already existed, or credential was revoked
201Wallet or credential was created
400Request body or x402 payment requirements failed validation
401Credential is missing, invalid, expired, or revoked
413Forwarded request body exceeded the configured limit
404Wallet or credential was not found within the caller's access boundary
409Resource state conflicts with the request
502Wallet provisioning, x402 signing, or the upstream request failed
504The upstream request timed out

Authentication

Secure Naven API credentials and wallet-scoped runtime credentials.

Genesis

Check eligibility and mint one Naven Genesis ERC-1155 NFT with USDG.

On this page

Base URLWallet objectList walletsCreate a walletGet a walletList wallet credentialsCreate a wallet credentialRevoke a wallet credentialResolve the current walletPay and call an x402 resourceStatus codes