Skip to main content

MCP (AI Commerce) API

MCP (Multi-Chain Payment) is an AI-powered commerce platform that enables users to purchase products using cryptocurrency through natural language processing and automated workflows. Supports both V1 (Neon only) and V2 (Multi-chain: Sepolia, Amoy, Neon) flows.

V1 Flow: Traditional Single-Chain (Neon)

Step 1: Detect Purchase Intent

POST/api/mcp/step1

Detect Purchase Intent

Analyze user input using Groq AI to detect purchase intent and extract product URLs. Uses llama-3.1-8b-instant model for intent detection.

Parameters

promptstringrequired

Natural language input from user expressing purchase intent

Request Body

{
  "prompt": "I want to buy wireless headphones from https://tokopedia.com/product/wireless-bluetooth-headphones"
}

Response

200Intent analyzed successfully
{
  "step": 1,
  "detected_intent": "YES - URL detected from shopping site indicates purchase intent",
  "detected_url": "https://tokopedia.com/product/wireless-bluetooth-headphones"
}
400Missing required prompt
{
  "error": "Prompt is required."
}
curl -X POST https://api.brdz.link/api/mcp/step1 \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "prompt": "I want to buy wireless headphones from https://tokopedia.com/product/wireless-bluetooth-headphones"
}'

Step 2: Parse Product Details

POST/api/mcp/step2

Parse Product Details

Extract product information from a given URL using parseProduct agent. Generates AI summary using Groq.

Parameters

urlstringrequired

Product URL to parse (from Step 1 or user input)

Request Body

{
  "url": "https://tokopedia.com/product/wireless-bluetooth-headphones"
}

Response

200Product parsed successfully
{
  "step": 2,
  "product": {
    "title": "Wireless Bluetooth Headphones Premium",
    "priceText": "Rp 299.000",
    "description": "High-quality wireless headphones with noise cancellation",
    "image": "https://images.tokopedia.net/img/product.jpg",
    "site": "tokopedia.com",
    "url": "https://tokopedia.com/product/wireless-bluetooth-headphones"
  },
  "ai_summary": "This is a premium wireless Bluetooth headphone with noise cancellation feature. The product offers excellent sound quality and long battery life, perfect for daily use and professional needs."
}
400Invalid or missing URL
{
  "error": "URL is missing or invalid."
}
500Failed to parse product
{
  "error": "Failed to process step 2",
  "details": "Unable to extract product information from URL"
}
curl -X POST https://api.brdz.link/api/mcp/step2 \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "url": "https://tokopedia.com/product/wireless-bluetooth-headphones"
}'

Step 3a: Product Confirmation & Pricing

POST/api/mcp/step3a

Product Confirmation & Pricing

Confirm product details and convert pricing to USDC using convertPriceToUSDC service. Generates AI confirmation message.

Parameters

productobjectrequired

Product object from Step 2 response

Request Body

{
  "product": {
    "title": "Wireless Bluetooth Headphones Premium",
    "priceText": "Rp 299.000",
    "description": "High-quality wireless headphones with noise cancellation",
    "image": "https://images.tokopedia.net/img/product.jpg",
    "site": "tokopedia.com",
    "url": "https://tokopedia.com/product/wireless-bluetooth-headphones"
  }
}

Response

200Product confirmed with USDC pricing
{
  "step": "3a",
  "product": {
    "title": "Wireless Bluetooth Headphones Premium",
    "description": "High-quality wireless headphones with noise cancellation",
    "image": "https://images.tokopedia.net/img/product.jpg",
    "site": "tokopedia.com",
    "url": "https://tokopedia.com/product/wireless-bluetooth-headphones"
  },
  "pricing": {
    "original": {
      "amount": 299000,
      "currency": "IDR",
      "formatted": "Rp 299.000"
    },
    "usdc": {
      "amount": 19.85,
      "formatted": "19.850000 USDC"
    },
    "conversion_rate": 15065.32,
    "route": "IDR -> USD -> USDC"
  },
  "ai_confirmation": "You're about to purchase Wireless Bluetooth Headphones Premium for Rp 299.000 (19.85 USDC). This premium quality headphone offers excellent features for your audio needs. Would you like to proceed with this purchase?",
  "ready_for_recipient_data": true
}
400Product data incomplete
{
  "error": "Product data incomplete",
  "required": [
    "product.title",
    "product.priceText"
  ]
}
500Failed to process confirmation
{
  "error": "Failed to process product confirmation",
  "details": "Currency conversion failed"
}
curl -X POST https://api.brdz.link/api/mcp/step3a \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "product": {
    "title": "Wireless Bluetooth Headphones Premium",
    "priceText": "Rp 299.000",
    "description": "High-quality wireless headphones"
  }
}'

Create Order (V1)

POST/api/mcp/create-order

Create Order

Create a new order with product details, pricing, and recipient information. Includes USDC balance verification on Neon chain. Requires authentication.

Parameters

productobjectrequired

Product object from Step 3a

pricingobjectrequired

Pricing object from Step 3a with USDC amounts

recipientobjectrequired

Recipient/shipping information

wallet_addressstringrequired

User's wallet address for balance check

Request Body

{
  "product": {
    "title": "Wireless Bluetooth Headphones Premium",
    "description": "High-quality wireless headphones",
    "image": "https://images.tokopedia.net/img/product.jpg",
    "site": "tokopedia.com",
    "url": "https://tokopedia.com/product/wireless-bluetooth-headphones"
  },
  "pricing": {
    "original": {
      "amount": 299000,
      "currency": "IDR",
      "formatted": "Rp 299.000"
    },
    "usdc": {
      "amount": 19.85,
      "formatted": "19.850000 USDC"
    },
    "conversion_rate": 15065.32
  },
  "recipient": {
    "name": "John Doe",
    "phone": "+628123456789",
    "address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia",
    "notes": "Please call before delivery"
  },
  "wallet_address": "0x1234567890123456789012345678901234567890"
}

Response

200Order created successfully
{
  "step": "create-order",
  "order_id": "ord_1234567890abcdef",
  "created_at": "2024-01-15T10:30:00Z",
  "wallet": {
    "address": "0x1234567890123456789012345678901234567890",
    "balance_usdc": 150,
    "balance_formatted": "150.000000 USDC"
  },
  "transaction": {
    "required_usdc": 19.85,
    "sufficient_balance": true,
    "can_proceed": true
  },
  "recipient": {
    "name": "John Doe",
    "phone": "+628123456789",
    "address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia",
    "notes": "Please call before delivery"
  },
  "pricing": {
    "original": {
      "amount": 299000,
      "currency": "IDR",
      "formatted": "Rp 299.000"
    },
    "usdc": {
      "amount": 19.85,
      "formatted": "19.850000 USDC"
    }
  },
  "ready_for_payment": true
}
400Missing required data or insufficient balance
{
  "error": "Missing required data",
  "required": [
    "product.title",
    "pricing.usdc.amount",
    "recipient.name",
    "recipient.address"
  ]
}
401Authentication required
{
  "error": "Authentication required"
}
curl -X POST https://api.brdz.link/api/mcp/create-order \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "product": {...},
  "pricing": {...},
  "recipient": {
    "name": "John Doe",
    "phone": "+628123456789",
    "address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia",
    "notes": "Please call before delivery"
  },
  "wallet_address": "0x1234567890123456789012345678901234567890"
}'

Execute Order (V1)

POST/api/mcp/execute-order

Execute Order

Execute payment for an order. Deducts USDC from user wallet via onchain transaction, processes offramp, calls MCP contract, and sends email receipt. Requires authentication.

Parameters

order_idstringrequired

Order ID from create-order response

confirmationstringrequired

Must contain 'confirm' to proceed with payment

wallet_addressstringrequired

User's wallet address for transaction execution

Request Body

{
  "order_id": "ord_1234567890abcdef",
  "confirmation": "confirmed",
  "wallet_address": "0x1234567890123456789012345678901234567890"
}

Response

200Order executed successfully
{
  "step": "execute-order",
  "success": true,
  "order": {
    "order_id": "ord_1234567890abcdef",
    "status": "COMPLETED",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:35:00Z"
  },
  "transaction": {
    "tx_hash_payment": "0xabc123def456789...",
    "tx_hash_mcp": "0x789def123abc456...",
    "mcp_status": "completed",
    "offramp_status": "SUCCESS_RECEIVE",
    "amount_paid": 19.85,
    "wallet_address": "0x1234567890123456789012345678901234567890"
  },
  "pricing": {
    "original": {
      "amount": 299000,
      "currency": "IDR",
      "formatted": "299000 IDR"
    },
    "usdc": {
      "amount": 19.85,
      "formatted": "19.85 USDC"
    }
  },
  "recipient": {
    "name": "John Doe",
    "phone": "+628123456789",
    "address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia",
    "notes": "Please call before delivery"
  },
  "email_sent": true,
  "completion_message": "Order ord_1234567890abcdef completed successfully. Receipt sent to user@example.com."
}
400Invalid confirmation or order issues
{
  "error": "User did not confirm purchase"
}
404Order not found
{
  "error": "Order not found"
}
curl -X POST https://api.brdz.link/api/mcp/execute-order \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "order_id": "ord_1234567890abcdef",
  "confirmation": "confirmed",
  "wallet_address": "0x1234567890123456789012345678901234567890"
}'

V2 Flow: Multi-Chain Support

Chain Selector

POST/api/mcp/chain-selector

Chain Selector

Display available blockchain networks for user selection after completing product and recipient data. Shows chain details, contract info, and gas estimates.

Parameters

productobjectrequired

Product object from Step 3a

pricingobjectrequired

Pricing object from Step 3a

recipientobjectrequired

Recipient information

Request Body

{
  "product": {
    "title": "Wireless Bluetooth Headphones Premium",
    "image": "https://images.tokopedia.net/img/product.jpg",
    "site": "tokopedia.com"
  },
  "pricing": {
    "original": {
      "formatted": "Rp 299.000"
    },
    "usdc": {
      "formatted": "19.850000 USDC"
    },
    "conversion_rate": 15065.32
  },
  "recipient": {
    "name": "John Doe",
    "address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia",
    "phone": "+628123456789"
  }
}

Response

200Chain options displayed successfully
{
  "step": "chain-selector",
  "version": "v2",
  "message": "Choose your preferred blockchain network",
  "order_summary": {
    "product": {
      "title": "Wireless Bluetooth Headphones Premium",
      "image": "https://images.tokopedia.net/img/product.jpg",
      "site": "tokopedia.com"
    },
    "pricing": {
      "original": "Rp 299.000",
      "usdc": "19.850000 USDC",
      "conversion_rate": 15065.32
    },
    "recipient": {
      "name": "John Doe",
      "address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia",
      "phone": "+628123456789"
    }
  },
  "chain_options": [
    {
      "id": "amoy",
      "name": "Polygon Amoy",
      "symbol": "MATIC",
      "is_testnet": true,
      "recommended": true,
      "gas_estimate": "~$0.01",
      "contract_info": {
        "usdc_contract": "0x...",
        "mcp_contract": "0x...",
        "rpc_url": "https://polygon-amoy.g.alchemy.com/v2/...",
        "explorer_url": "https://amoy.polygonscan.com/"
      }
    },
    {
      "id": "sepolia",
      "name": "Sepolia Testnet",
      "symbol": "ETH",
      "is_testnet": true,
      "recommended": false,
      "gas_estimate": "~$0.05",
      "contract_info": {
        "usdc_contract": "0x...",
        "mcp_contract": "0x...",
        "rpc_url": "https://sepolia.infura.io/v3/...",
        "explorer_url": "https://sepolia.etherscan.io/"
      }
    },
    {
      "id": "neon",
      "name": "Neon DevNet",
      "symbol": "NEON",
      "is_testnet": true,
      "recommended": false,
      "gas_estimate": "~$0.05",
      "contract_info": {
        "usdc_contract": "0x...",
        "mcp_contract": "0x...",
        "rpc_url": "https://devnet.neonevm.org",
        "explorer_url": "https://neon-devnet.blockscout.com/"
      }
    }
  ],
  "instructions": {
    "title": "Select Blockchain Network",
    "steps": [
      "1. Choose your preferred network below",
      "2. Connect wallet for the selected network",
      "3. Confirm balance and complete payment"
    ],
    "note": "Polygon Amoy is recommended for lower gas fees"
  },
  "next_step": {
    "endpoint": "/api/mcp/create-order",
    "method": "POST",
    "required_fields": [
      "selected_chain",
      "wallet_address"
    ],
    "note": "Include selected_chain parameter to use V2 flow"
  }
}
400Missing data from previous steps
{
  "error": "Missing data from previous steps",
  "required": [
    "product.title",
    "pricing.usdc.amount",
    "recipient.name",
    "recipient.address"
  ]
}
curl -X POST https://api.brdz.link/api/mcp/chain-selector \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "product": {...},
  "pricing": {...},
  "recipient": {...}
}'

Create Order V2

POST/api/mcp/v2/create-order

Create Order V2 (Multi-Chain)

Create order with blockchain network selection. Validates chain configuration, wallet on selected chain, and checks USDC balance. Stores chain metadata in order. Requires authentication.

Parameters

productobjectrequired

Product object from Step 3a

pricingobjectrequired

Pricing object from Step 3a

recipientobjectrequired

Recipient information

selected_chainstringrequired

Selected blockchain ID (sepolia, amoy, neon)

wallet_addressstringrequired

User's wallet address for selected chain

Request Body

{
  "product": {
    "title": "Wireless Bluetooth Headphones Premium"
  },
  "pricing": {
    "original": {
      "amount": 299000,
      "currency": "IDR"
    },
    "usdc": {
      "amount": 19.85
    },
    "conversion_rate": 15065.32
  },
  "recipient": {
    "name": "John Doe",
    "phone": "+628123456789",
    "address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia"
  },
  "selected_chain": "amoy",
  "wallet_address": "0x1234567890123456789012345678901234567890"
}

Response

200V2 Order created successfully
{
  "step": "create-order-v2",
  "version": "v2",
  "order_id": "ord_v2_1234567890abcdef",
  "created_at": "2024-01-15T10:30:00Z",
  "chain_info": {
    "selected_chain": "amoy",
    "chain_name": "Polygon Amoy",
    "contract_info": {
      "usdc_contract": "0x...",
      "mcp_contract": "0x...",
      "rpc_url": "https://polygon-amoy.g.alchemy.com/v2/...",
      "explorer_url": "https://amoy.polygonscan.com/"
    }
  },
  "wallet": {
    "address": "0x1234567890123456789012345678901234567890",
    "balance_usdc": 150,
    "balance_display": "150.000000 USDC",
    "validated": true
  },
  "transaction": {
    "required_usdc": 19.85,
    "sufficient_balance": true,
    "can_proceed": true
  },
  "order_details": {
    "product": {
      "title": "Wireless Bluetooth Headphones Premium"
    },
    "pricing": {
      "original": {
        "amount": 299000,
        "currency": "IDR"
      },
      "usdc": {
        "amount": 19.85
      }
    },
    "recipient": {
      "name": "John Doe",
      "phone": "+628123456789",
      "address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia"
    }
  },
  "next_step": "execute-order",
  "ready_for_payment": true
}
400Invalid chain or wallet validation failed
{
  "error": "Chain selection required for V2 flow",
  "available_chains": [
    "sepolia",
    "amoy",
    "neon"
  ]
}
curl -X POST https://api.brdz.link/api/mcp/v2/create-order \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "product": {...},
  "pricing": {...},
  "recipient": {...},
  "selected_chain": "amoy",
  "wallet_address": "0x1234567890123456789012345678901234567890"
}'

Execute Order V2

POST/api/mcp/v2/execute-order

Execute Order V2 (Multi-Chain)

Execute payment on selected blockchain network. Detects chain from order metadata, validates wallet, executes onchain transaction, processes offramp, calls MCP contract on correct chain, and sends email. Requires authentication.

Parameters

order_idstringrequired

Order ID from V2 create-order response

confirmationstringrequired

Must contain 'confirm' to proceed

wallet_addressstringrequired

User's wallet address

Request Body

{
  "order_id": "ord_v2_1234567890abcdef",
  "confirmation": "confirmed",
  "wallet_address": "0x1234567890123456789012345678901234567890"
}

Response

200V2 Order executed successfully
{
  "step": "execute-order-v2",
  "version": "v2",
  "success": true,
  "order": {
    "order_id": "ord_v2_1234567890abcdef",
    "status": "COMPLETED",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:35:00Z"
  },
  "chain_execution": {
    "chain_id": "amoy",
    "chain_name": "Polygon Amoy",
    "is_v2_flow": true
  },
  "transaction": {
    "tx_hash_payment": "0xabc123def456789...",
    "tx_hash_mcp": "0x789def123abc456...",
    "payment_explorer": "https://amoy.polygonscan.com/tx/0xabc123def456789...",
    "mcp_explorer": "https://amoy.polygonscan.com/tx/0x789def123abc456...",
    "mcp_status": "completed",
    "offramp_status": "SUCCESS_RECEIVE",
    "amount_paid": 19.85,
    "wallet_address": "0x1234567890123456789012345678901234567890"
  },
  "pricing": {
    "original": {
      "amount": 299000,
      "currency": "IDR",
      "formatted": "299000 IDR"
    },
    "usdc": {
      "amount": 19.85,
      "formatted": "19.85 USDC"
    }
  },
  "recipient": {
    "name": "John Doe",
    "phone": "+628123456789",
    "address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia",
    "notes": "{\"selected_chain\":\"amoy\",\"chain_name\":\"Polygon Amoy\",\"wallet_validated\":true,\"balance_checked\":true,\"v2_flow\":true}"
  },
  "email_sent": true,
  "completion_message": "Order ord_v2_1234567890abcdef completed successfully on Polygon Amoy. Receipt sent to user@example.com."
}
400Wallet validation failed or confirmation missing
{
  "error": "Purchase confirmation required"
}
404Order not found
{
  "error": "Order not found"
}
curl -X POST https://api.brdz.link/api/mcp/v2/execute-order \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "order_id": "ord_v2_1234567890abcdef",
  "confirmation": "confirmed",
  "wallet_address": "0x1234567890123456789012345678901234567890"
}'

Chain Balance Check

POST/api/mcp/chain-balance

Check Chain Balance

Utility endpoint to check USDC balance on specific blockchain network. Used for wallet validation and balance verification.

Parameters

wallet_addressstringrequired

Wallet address to check balance

chain_idstringrequired

Chain ID (sepolia, amoy, neon)

Request Body

{
  "wallet_address": "0x1234567890123456789012345678901234567890",
  "chain_id": "amoy"
}

Response

200Balance retrieved successfully
{
  "success": true,
  "data": {
    "chain_id": "amoy",
    "chain_name": "Polygon Amoy",
    "wallet_address": "0x1234567890123456789012345678901234567890",
    "usdc_balance": {
      "raw_balance": "150000000",
      "formatted_balance": "150.0",
      "display_balance": "150.000000 USDC",
      "decimals": 6
    },
    "contract_info": {
      "usdc_contract": "0x...",
      "rpc_url": "https://polygon-amoy.g.alchemy.com/v2/..."
    }
  }
}
400Invalid parameters
{
  "error": "Missing required parameters",
  "required": [
    "wallet_address",
    "chain_id"
  ]
}
curl -X POST https://api.brdz.link/api/mcp/chain-balance \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "wallet_address": "0x1234567890123456789012345678901234567890",
  "chain_id": "amoy"
}'

Order Management & Dashboard

Get Order Details

GET/api/mcp/order/{order_id}

Get Order Details

Retrieve detailed information about a specific order. Requires authentication and user ownership validation.

Parameters

order_idstringrequired

Order ID to retrieve (path parameter)

Response

200Order details retrieved
{
  "order": {
    "order_id": "ord_1234567890abcdef",
    "user_id": 123,
    "product_data": {
      "title": "Wireless Bluetooth Headphones Premium",
      "description": "High-quality wireless headphones",
      "image": "https://images.tokopedia.net/img/product.jpg",
      "site": "tokopedia.com",
      "url": "https://tokopedia.com/product/wireless-bluetooth-headphones"
    },
    "recipient_name": "John Doe",
    "recipient_phone": "+628123456789",
    "recipient_address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia",
    "original_price": 299000,
    "original_currency": "IDR",
    "usdc_amount": 19.85,
    "conversion_rate": 15065.32,
    "order_status": "COMPLETED",
    "tx_hash_burn": "0xabc123def456789...",
    "tx_hash_mcp": "0x789def123abc456...",
    "email_sent": true,
    "special_notes": "Please call before delivery",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:35:00Z"
  },
  "product": {
    "title": "Wireless Bluetooth Headphones Premium",
    "description": "High-quality wireless headphones",
    "image": "https://images.tokopedia.net/img/product.jpg"
  }
}
401Authentication required
{
  "error": "Authentication required"
}
404Order not found
{
  "error": "Order not found"
}
curl -X GET https://api.brdz.link/api/mcp/order/ord_1234567890abcdef \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

Get Recent Orders

GET/api/mcp/orders/recent

Get Recent Orders

Get user's recent orders with optional limit for dashboard display. Returns formatted order data. Requires authentication.

Parameters

limitnumber

Maximum number of orders to return (default: 5, max: 50)

Response

200Recent orders retrieved
{
  "success": true,
  "data": [
    {
      "order_id": "ord_1234567890abcdef",
      "product_title": "Wireless Bluetooth Headphones Premium",
      "product_image": "https://images.tokopedia.net/img/product.jpg",
      "amount": 299000,
      "currency": "IDR",
      "usdc_amount": 19.85,
      "status": "COMPLETED",
      "created_at": "2024-01-15T10:30:00Z",
      "formatted_amount": "299000 IDR",
      "formatted_usdc": "19.85 USDC"
    },
    {
      "order_id": "ord_0987654321fedcba",
      "product_title": "Smart Watch Series 5",
      "product_image": "https://images.tokopedia.net/img/watch.jpg",
      "amount": 1499000,
      "currency": "IDR",
      "usdc_amount": 99.5,
      "status": "PENDING",
      "created_at": "2024-01-14T15:20:00Z",
      "formatted_amount": "1499000 IDR",
      "formatted_usdc": "99.50 USDC"
    }
  ],
  "count": 2
}
401Authentication required
{
  "error": "Authentication required"
}
curl -X GET "https://api.brdz.link/api/mcp/orders/recent?limit=10" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

Get Dashboard Stats

GET/api/mcp/orders/stats

Get Dashboard Stats

Get user's order statistics for dashboard display including total orders, completion rate, and spending totals. Requires authentication.

Response

200Dashboard stats retrieved
{
  "success": true,
  "data": {
    "total_orders": 25,
    "completed_orders": 23,
    "processing_orders": 1,
    "total_spent_usdc": 1250.75,
    "completion_rate": 92,
    "formatted_total_spent": "1250.75 USDC"
  }
}
401Authentication required
{
  "error": "Authentication required"
}
curl -X GET https://api.brdz.link/api/mcp/orders/stats \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

Get All User Orders

GET/api/mcp/orders

Get All User Orders

Get all user orders with pagination support. Returns complete order details with formatted fields. Requires authentication.

Parameters

limitnumber

Maximum records per page (default: 20, max: 100)

offsetnumber

Records to skip for pagination (default: 0)

Response

200User orders retrieved with pagination
{
  "success": true,
  "data": [
    {
      "order_id": "ord_1234567890abcdef",
      "product_data": {
        "title": "Wireless Bluetooth Headphones Premium",
        "image": "https://images.tokopedia.net/img/product.jpg"
      },
      "product_title": "Wireless Bluetooth Headphones Premium",
      "product_image": "https://images.tokopedia.net/img/product.jpg",
      "recipient_name": "John Doe",
      "recipient_address": "Jl. Sudirman No. 123, Jakarta Selatan 12190, Indonesia",
      "recipient_phone": "+628123456789",
      "original_price": 299000,
      "original_currency": "IDR",
      "usdc_amount": 19.85,
      "order_status": "COMPLETED",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:35:00Z",
      "tx_hash_payment": "0xabc123def456789...",
      "tx_hash_mcp": "0x789def123abc456...",
      "email_sent": true,
      "special_notes": "Please call before delivery",
      "formatted_amount": "299000 IDR",
      "formatted_usdc": "19.85 USDC"
    }
  ],
  "pagination": {
    "count": 1,
    "limit": 20,
    "offset": 0,
    "has_more": false
  }
}
401Authentication required
{
  "error": "Authentication required"
}
curl -X GET "https://api.brdz.link/api/mcp/orders?limit=20&offset=0" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"

Supported Chains (V2)

Chain IDNameSymbolNetworkUSDC ContractExplorer
sepoliaSepolia TestnetETHEthereum Testnet0x...sepolia.etherscan.io
amoyPolygon AmoyMATICPolygon Testnet0x...amoy.polygonscan.com
neonNeon DevNetNEONNeon EVM Testnet0x...neon-devnet.blockscout.com

Authentication Requirements

EndpointAuthenticationAPI KeyUser Validation
Step 1, 2, 3a, Chain Selector
Create Order (V1/V2)✅ (eKYC + Active)
Execute Order (V1/V2)✅ (eKYC + Active)
Order Details, Stats, Recent
Chain Balance

Error Codes

CodeDescriptionCommon Causes
400Bad RequestMissing parameters, invalid data, insufficient balance
401UnauthorizedMissing/invalid JWT token, API key missing
403ForbiddenUser not eKYC approved, account not active
404Not FoundOrder not found, invalid order_id
500Internal ErrorGroq API failure, blockchain RPC error, parsing failure

Complete Workflow Examples
  • V1 Flow: step1 → step2 → step3a → create-order → execute-order
  • V2 Flow: step1 → step2 → step3a → chain-selector → v2/create-order → v2/execute-order
Supported Platforms
  • Tokopedia - Indonesian e-commerce
  • Shopee - Southeast Asian marketplace
  • Amazon - Global marketplace
  • More platforms - Being added continuously
Important Notes
  • Orders expire 60 minutes after creation
  • V2 orders store chain metadata in special_notes as JSON
  • All prices converted via real-time FX rates: originalCurrency → USD → USDC
  • Transaction hashes available in both payment and MCP explorer links
  • Email receipts sent automatically upon successful completion