Skip to main content
GET
/
api
/
x402
/
base
/
jobs
/
{jobId}
/
pay
curl -X GET "https://wurkapi.fun/api/x402/base/jobs/89e57c15/pay" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Accept: application/json"
{
  "x402Version": 1,
  "accepts": [
    {
      "scheme": "exact",
      "network": "base",
      "maxAmountRequired": "2500000",
      "resource": "https://wurkapi.fun/api/x402/base/jobs/21752134/pay",
      "description": "",
      "mimeType": "",
      "payTo": "0xF00DAF15713e82fBb7bDC4b818444D93D655DE96",
      "asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
      "maxTimeoutSeconds": 60,
      "extra": {
        "chainId": 8453,
        "decimals": 6,
        "eip712": {
          "name": "USD Coin",
          "version": "2"
        },
        "name": "USD Coin",
        "version": "2"
      }
    }
  ]
}

Authentication

X-API-Key
string
required
Your WURK API key
X-PAYMENT
string
required
Payment header generated by x402 client library. Required to complete the payment (second request)

Path Parameters

jobId
string
required
The job ID (8 character identifier returned from job creation)

Flow

This endpoint requires two requests to complete a payment:
  1. First Request (without X-PAYMENT): Returns 402 with payment requirements
  2. Second Request (with X-PAYMENT): Processes payment and returns 200 on success
The X-PAYMENT header is required to actually process the payment. Without it, you’ll only receive the payment requirements (402 response).

Response

First Request (402)

x402Version
number
x402 protocol version (currently 1)
accepts
array
Array of payment requirement objects with fields:
  • scheme: Payment scheme ("exact")
  • network: Blockchain network ("base")
  • maxAmountRequired: Amount in smallest unit (e.g., "2500000" for 2.5 USDC)
  • resource: The payment endpoint URL
  • payTo: Recipient wallet address
  • asset: USDC contract address on Base (0x833589fcd6edb6e08f4c7c32d4f71b54bda02913)
  • maxTimeoutSeconds: Payment timeout (typically 60)
  • extra: Additional data including:
    • chainId: Base mainnet chain ID (8453)
    • decimals: USDC decimals (6)
    • eip712: EIP-712 domain parameters
    • name: Token name ("USD Coin")
    • version: EIP-712 version ("2")

Second Request (200)

ok
boolean
Always true on success
paid
boolean
true when payment is confirmed
jobId
string
The job ID that was paid
x-payment-response
string
Optional header containing settlement details (transaction hash, network)

Implementation Examples

curl -X GET "https://wurkapi.fun/api/x402/base/jobs/89e57c15/pay" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Accept: application/json"

Hosted Payment UI

You can also use a hosted payment interface for wallet-based payments:
https://echo.payai.network/?resource=<url-encoded-resource-url>
Example for a job payment:
https://echo.payai.network/?resource=https%3A%2F%2Fwurkapi.fun%2Fapi%2Fx402%2Fbase%2Fjobs%2F<jobId>%2Fpay
{
  "x402Version": 1,
  "accepts": [
    {
      "scheme": "exact",
      "network": "base",
      "maxAmountRequired": "2500000",
      "resource": "https://wurkapi.fun/api/x402/base/jobs/21752134/pay",
      "description": "",
      "mimeType": "",
      "payTo": "0xF00DAF15713e82fBb7bDC4b818444D93D655DE96",
      "asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
      "maxTimeoutSeconds": 60,
      "extra": {
        "chainId": 8453,
        "decimals": 6,
        "eip712": {
          "name": "USD Coin",
          "version": "2"
        },
        "name": "USD Coin",
        "version": "2"
      }
    }
  ]
}

Common Errors

simulation_reverted: Usually means insufficient USDC balance. Ensure the payer wallet has at least the maxAmountRequired amount of USDC on Base (remember USDC has 6 decimals).
invalid_exact_evm_payload_signature: EIP-712 domain mismatch. The x402-axios interceptor handles this automatically, but if building manually, ensure you use the exact fields from accepts.extra.

Technical Details

EIP-3009 Authorization

The Base implementation uses EIP-3009 (transferWithAuthorization) for USDC transfers. The x402 library automatically:
  1. Creates an EIP-712 typed data structure
  2. Signs the authorization with your private key
  3. Encodes it in the X-PAYMENT header
  4. The facilitator verifies and executes the transfer on-chain

Prerequisites

  • EVM wallet with USDC on Base mainnet (chainId: 8453)
  • Sufficient USDC balance (check maxAmountRequired)
  • Optional: Base RPC endpoint for balance checks

Network Information

  • Chain: Base Mainnet
  • Chain ID: 8453
  • USDC Contract: 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
  • Payment Receiver: 0xF00DAF15713e82fBb7bDC4b818444D93D655DE96