Skip to content

Parth59/bitebitebot

Repository files navigation

Merchant Portal - ETH Denver 2026

A Next.js application for merchant onboarding and configuration management.

Features

  1. Merchant Onboarding - Complete onboarding form for new merchants
  2. Merchant Configuration - Configure receiving address and settlement token settings

Getting Started

First, install the dependencies:

npm install

Then, run the development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.

Project Structure

  • /app - Next.js App Router pages and components
    • /onboarding - Merchant onboarding page
    • /configuration - Merchant configuration page
  • /components - Reusable React components (if needed)

Technologies

  • Next.js 14 (App Router)
  • TypeScript
  • Tailwind CSS
  • React 18

Pages

  • / - Home page with navigation to onboarding and configuration
  • /onboarding - Merchant onboarding form
  • /configuration - Merchant list; click Configure to go to /configuration/[merchantId]
  • /configuration/[merchantId] - Configure one merchant (settlement + products)

API

Data is stored in data/merchants.json. All endpoints expect and return JSON.

Base URL (dev): http://localhost:3000/api

1. Create merchant (onboarding)

POST /api/merchants

Creates a new merchant. Used when completing onboarding.

Request body:

{
  "businessName": "Acme Store",
  "email": "hello@acme.com",
  "phone": "+1 555 123 4567",
  "businessType": "retail",
  "website": "https://acme.com",
  "description": "Widgets and gadgets",
  "receivingAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "settlementToken": "ADI"
}

Response: 201 – the created merchant (includes id and createdAt).

{
  "id": "1739123456789",
  "businessName": "Acme Store",
  "email": "hello@acme.com",
  "phone": "+1 555 123 4567",
  "businessType": "retail",
  "website": "https://acme.com",
  "description": "Widgets and gadgets",
  "receivingAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "settlementToken": "ADI",
  "createdAt": "2026-02-19T12:00:00.000Z"
}

Example (curl):

curl -X POST http://localhost:3000/api/merchants \
  -H "Content-Type: application/json" \
  -d '{"businessName":"Acme Store","email":"hello@acme.com","phone":"+1 555 123 4567","businessType":"retail","website":"https://acme.com","description":"Widgets","receivingAddress":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb","settlementToken":"ADI"}'

2. List all merchants

GET /api/merchants

Returns all merchants (used on the configuration list page).

Response: 200 – array of merchants.

[
  {
    "id": "1739123456789",
    "businessName": "Acme Store",
    "email": "hello@acme.com",
    "receivingAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "settlementToken": "ADI",
    "products": [],
    "createdAt": "2026-02-19T12:00:00.000Z"
  }
]

Example (curl):

curl http://localhost:3000/api/merchants

3. Get one merchant

GET /api/merchants/[id]

Returns a single merchant by ID (e.g. for the configuration detail page).

Response: 200 – the merchant; 404 if not found.

{
  "id": "1739123456789",
  "businessName": "Acme Store",
  "email": "hello@acme.com",
  "phone": "+1 555 123 4567",
  "businessType": "retail",
  "website": "https://acme.com",
  "description": "Widgets and gadgets",
  "receivingAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "settlementToken": "ADI",
  "autoSettlement": false,
  "settlementThreshold": "",
  "products": [
    {
      "id": "1739123500000",
      "name": "Blue Widget",
      "priceUsd": "19.99",
      "imageUrl": "https://example.com/widget.jpg"
    }
  ],
  "createdAt": "2026-02-19T12:00:00.000Z"
}

Example (curl):

curl http://localhost:3000/api/merchants/1739123456789

4. Update merchant (configuration + products)

PUT /api/merchants/[id]

Updates a merchant. Used for:

  • Configuring settlement (receiving address, settlement token, auto-settlement, threshold)
  • Adding/removing products by sending the full products array

Send only the fields you want to update.

Request body (settlement config):

{
  "receivingAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "settlementToken": "USDC",
  "autoSettlement": true,
  "settlementThreshold": "100"
}

Request body (add/update products):

{
  "products": [
    {
      "id": "1739123500000",
      "name": "Blue Widget",
      "priceUsd": "19.99",
      "imageUrl": "https://example.com/widget.jpg"
    },
    {
      "id": "1739123600000",
      "name": "Red Gadget",
      "priceUsd": "29.50",
      "imageUrl": ""
    }
  ]
}

Response: 200 – the updated merchant; 404 if not found.

Example (curl) – update settlement:

curl -X PUT http://localhost:3000/api/merchants/1739123456789 \
  -H "Content-Type: application/json" \
  -d '{"receivingAddress":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb","settlementToken":"USDC","autoSettlement":true,"settlementThreshold":"100"}'

Example (curl) – add a product:

curl -X PUT http://localhost:3000/api/merchants/1739123456789 \
  -H "Content-Type: application/json" \
  -d '{"products":[{"id":"1","name":"Blue Widget","priceUsd":"19.99","imageUrl":"https://example.com/widget.jpg"}]}'

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors