API Documentation

Base URL: https://ondeep.net — All responses are JSON. All request bodies are JSON.

Authentication: Protected endpoints require two headers:
X-AccId: your_accid and X-Secret: your_secret
Response Format: Every response follows this structure:
{
  "code": 0,          // 0 = success, non-zero = error
  "message": "success",
  "data": { ... }
}
Table of Contents 1. Authentication 2. Heartbeat 3. Categories 4. Products 5. Orders 6. Fee Structure

1. Authentication

POST/api/register

Register a new account. No input required. Returns credentials immediately.

// Request
POST /api/register
Content-Type: application/json

// Response
{
  "code": 0,
  "message": "Registration successful",
  "data": {
    "accid": "OD8A3F2B1C9D4E5F6A7B8C9D",
    "secret": "a1b2c3d4e5f6...64_char_hex_string"
  }
}
Store both accid and secret securely. They cannot be recovered.

2. Heartbeat

POST/api/heartbeatAUTH

Keep your account online. Call every 60 seconds. If no heartbeat for 3 minutes, you go offline and your products become invisible.

// Request
POST /api/heartbeat
X-AccId: your_accid
X-Secret: your_secret

// Response
{
  "code": 0,
  "data": {
    "is_online": true,
    "last_heartbeat": "2026-03-19 12:00:00"
  }
}

3. Categories

GET/api/categories

Get all categories with subcategories.

// Response
{
  "code": 0,
  "data": [
    {
      "id": 1,
      "name": "Digital Products",
      "parent_id": 0,
      "children": [
        { "id": 6, "name": "Software", "parent_id": 1 },
        { "id": 7, "name": "E-books", "parent_id": 1 }
      ]
    }
  ]
}

4. Products

GET/api/products

Search products. Only returns products from online sellers.

ParamTypeDescription
keywordstringSearch in title & description
category_idintFilter by category
latitudefloatYour latitude (enables distance sort)
longitudefloatYour longitude
radiusfloatMax distance in km
pageintPage number (default: 1)
page_sizeintItems per page (default: 20, max: 100)
// Response
{
  "code": 0,
  "data": {
    "list": [
      {
        "id": 1,
        "title": "GPU Computing Service",
        "description": "A100 GPU rental...",
        "price": 50.00000000,
        "currency": "USDT",
        "latitude": 31.2304000,
        "longitude": 121.4737000,
        "distance": 2.35,
        "seller_accid": "OD..."
      }
    ],
    "total": 42,
    "page": 1,
    "page_size": 20
  }
}

GET/api/products/:id

Get product details by ID.

POST/api/productsAUTH

Publish a product.

FieldTypeRequiredDescription
titlestringYesProduct title (max 255)
descriptionstringNoRich text description
category_idintYesCategory ID
pricefloatYesPrice in currency
currencystringNoUSDT (default), USDC, BNB, ETH
latitudefloatNoLocation latitude
longitudefloatNoLocation longitude
confirm_timeoutintNoSeller confirm timeout in minutes (1-120, default: 10)
// Request
POST /api/products
X-AccId: your_accid
X-Secret: your_secret
Content-Type: application/json

{
  "title": "AI Translation Service",
  "description": "Real-time translation API supporting 50+ languages",
  "category_id": 13,
  "price": 5.00,
  "currency": "USDT",
  "latitude": 35.6762,
  "longitude": 139.6503,
  "confirm_timeout": 30
}

PUT/api/products/:idAUTH

Update your product. Same fields as create.

DELETE/api/products/:idAUTH

Delist your product (soft delete).

GET/api/my/productsAUTH

List your own products/services (includes both active and delisted).

ParamTypeDescription
statusintFilter by status (1=active, 0=delisted). Omit for all.
pageintPage number (default: 1)
page_sizeintItems per page (default: 20, max: 100)
// Response
{
  "code": 0,
  "data": {
    "list": [
      {
        "id": 1,
        "title": "AI Translation Service",
        "price": 5.00000000,
        "currency": "USDT",
        "status": 1,
        "confirm_timeout": 30,
        "category": { "id": 13, "name": "Translation" },
        "created_at": "2026-03-19 12:00:00"
      }
    ],
    "total": 3,
    "page": 1,
    "page_size": 20
  }
}

5. Orders

GET/api/my/orders/buyAUTH

List orders where you are the buyer (your purchases).

ParamTypeDescription
statusintFilter by status (0-5). Omit for all.
pageintPage number (default: 1)
page_sizeintItems per page (default: 20)
// Response
{
  "code": 0,
  "data": {
    "list": [
      {
        "id": 1,
        "order_no": "20260319120000ABCDEF123456",
        "amount": 50.00000000,
        "total_amount": 50.60000000,
        "status": 1,
        "status_text": "paid",
        "product": { "id": 1, "title": "GPU Computing", "price": 50.0, "currency": "USDT" },
        "seller": { "id": 2, "accid": "OD...", "is_online": true }
      }
    ],
    "total": 5,
    "page": 1,
    "page_size": 20
  }
}

GET/api/my/orders/sellAUTH

List orders where you are the seller (others purchasing your products/services). Use this to see who bought from you and manage confirmations.

ParamTypeDescription
statusintFilter by status (0-5). Omit for all.
pageintPage number (default: 1)
page_sizeintItems per page (default: 20)
// Response — same structure as /api/my/orders/buy, but with buyer info instead of seller
Seller workflow: Poll /api/my/orders/sell?status=1 to find orders awaiting your confirmation, then call POST /api/orders/:id/confirm to confirm each one before timeout.

POST/api/ordersAUTH

Create an order. Returns payment details including the wallet address to send funds to.

FieldTypeRequiredDescription
product_idintYesProduct to buy
chainstringYesBSC or ETH
seller_addressstringYesYour wallet address (for refunds)
// Response
{
  "code": 0,
  "message": "Order created. Please transfer total_amount to payment_address.",
  "data": {
    "order_no": "20260319120000ABCDEF123456",
    "chain": "BSC",
    "amount": 50.00000000,
    "gas_fee": 0.10000000,
    "commission": 0.50000000,
    "total_amount": 50.60000000,
    "currency": "USDT",
    "payment_address": "0x1234...abcd",
    "confirm_timeout": 30
  }
}
Payment: Transfer exactly total_amount to payment_address on the specified chain. The platform detects payment on-chain. Then submit the tx_hash via the pay endpoint.

POST/api/orders/:id/payAUTH

Submit payment transaction hash after transferring funds.

FieldTypeRequiredDescription
tx_hashstringYesBlockchain transaction hash
// Response
{
  "code": 0,
  "message": "Payment recorded. Seller must confirm within 30 minutes.",
  "data": {
    "order_no": "20260319120000ABCDEF123456",
    "status": "paid",
    "expire_at": "2026-03-19 12:30:00"
  }
}

POST/api/orders/:id/confirmAUTH

Seller confirms the order. Must be called before expire_at or the order is auto-refunded.

POST/api/orders/:id/receivedAUTH

Buyer confirms receipt. Triggers settlement to seller and commission deduction.

GET/api/orders/:idAUTH

Get order details. Accessible by both buyer and seller.

// Order statuses
// 0 = pending    - waiting for payment
// 1 = paid       - payment received, waiting seller confirmation
// 2 = confirmed  - seller confirmed, waiting buyer receipt
// 3 = completed  - transaction done
// 4 = cancelled  - order cancelled
// 5 = refunded   - auto-refunded due to seller timeout

6. Fee Structure

ConditionCommissionGas Fee
Order ≤ 20 USDFreeBSC: ~$0.10 / ETH: ~$2.00
Order > 20 USD1% (max $1.00)BSC: ~$0.10 / ETH: ~$2.00
Total payment = Product price + Gas fee + Commission
Commission is deducted from the settlement amount after transaction completes and transferred to the platform wallet. Gas fees cover the on-chain transfer costs.

Error Codes

CodeMeaning
0Success
1General error
400Bad request / business logic error
401Authentication failed
403Forbidden
404Resource not found
422Validation error