Create Gig with X402 Payment

Creates a new gig with X402 payment integration. This endpoint implements the X402 payment standard for seamless token payments. The gig will be created and automatically started after successful payment.

X402 Payment Flow

IMPORTANT: This endpoint uses X402 payment authentication. The payment flow works as follows:

  1. First Call: Returns 402 status with payment details

  2. Payment: User completes payment through X402

  3. Second Call: Gig is created and started automatically

Authentication

This endpoint uses X402 payment authentication instead of API keys. The payment header is automatically handled by the X402 middleware.

Endpoint

POST https://gigbot.xyz/api/gigs/create/x402

Input Parameters

{
  chain: "base",                               // Currently only Base network supported
  token_address: string,                       // ERC20 token contract address (only USDC supported)
  amount: number,                              // Reward amount in tokens (e.g., 11) - commission is added on top
  start_time: string,                          // ISO datetime (e.g., "2025-10-01T15:00:00Z")
  duration: "1day" | "3days",                 // Only 1day and 3days supported for X402
  gig_type: "mention" | "like" | "recast" | "boost" | "custom_bounty" | "follow" | "hold_erc20" | "buy_erc20",
  platform?: "farcaster" | "x" | "onchain",   // Optional - defaults to "farcaster"
  url?: string,                                // Required for like, recast, boost, follow tasks
  how_to_earn?: string,                        // Required for custom_bounty, optional for others
  earning_criteria?: string,                   // Optional - will use default if not provided
  keyword?: string,                            // Optional - for mention gigs (defaults to token symbol)
  token_contract?: string,                     // Required for hold_erc20 and buy_erc20 gigs
  token_amount_needed?: number,                // Required for hold_erc20 and buy_erc20 gigs
  verifier?: string                            // Optional - custom verifier for the gig
}

Examples

Custom Bounty Gig

Follow Gig

Hold ERC20 Token Gig

Buyer Example Script

As a buyer, you can call the X402 endpoint like this:

Success Response (200)

X402 Payment Response (402)

When payment is required, the endpoint returns a 402 status with X402 payment details:

Errors

400: Validation Errors

404: Resource Not Found

500: Server Error

Important Notes

Supported Token

  • Only USDC is supported: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

  • Minimum value: $10 USD (commission is added on top, so you pay $11 total for $10 reward)

X402 Integration

  • Uses X402 payment middleware for seamless token payments

  • Automatically creates a wallet for the gig

  • Payment is required before gig creation

  • Gig is automatically started after successful payment

Commission Structure

  • Platform fee: 10% commission on top of the reward amount

  • Example: If you want to distribute $10, you pay $11 total ($10 reward + $1 commission)

Gig Types

  • mention: Users mention a keyword in their posts

  • like: Users like a specific post

  • recast: Users recast a specific post

  • boost: Users boost a specific post

  • custom_bounty: Custom task with custom instructions

  • follow: Users follow a specific account

  • hold_erc20: Users hold a specific amount of ERC20 tokens

  • buy_erc20: Users buy a specific amount of ERC20 tokens

Platform Support

  • farcaster: Farcaster platform

  • x: X/Twitter platform

  • onchain: On-chain activities (for hold_erc20 and buy_erc20)

URL Format Requirements

  • Farcaster: https://farcaster.xyz/{username}/0x{hash} or https://farcaster.xyz/{username}

  • X/Twitter: https://twitter.com/{username}/status/{tweet_id}

  • Custom: Any valid URL for custom_bounty gigs

Duration Options

  • 1day: 24 hours (quick promotions)

  • 3days: 72 hours (weekend events)

Last updated