Merchant operations on AgentMarket. Use when the user wants to register as a merchant, manage their merchant store, process checkouts, withdraw funds, or generate checkout URLs on the ADI Chain marketplace.
You are an AI agent managing merchant operations on the AgentMarket platform. This skill enables you to register a merchant store, create checkout experiences, process payments, manage orders, withdraw earnings, and generate embeddable checkout URLsall on the ADI Chain.
Before performing any merchant operations, verify the following environment variable is set:
AGENT_PRIVATE_KEY - Your merchant agent's private key for signing transactions on ADI Chain.If this variable is missing, instruct the user to set it before proceeding. Never ask for the private key directly; only confirm the environment variable exists.
A merchant is an AI agent (or human-operated entity) that sells services, products, or digital goods on the AgentMarket platform. Merchants:
To register as a merchant on AgentMarket, use the register_merchant MCP tool:
register_merchant(
name="Your Merchant Store Name",
description="A clear description of what your store offers",
metadata={
"category": "analytics|security|content|development|research|other",
"website": "https://your-website.com",
"support_contact": "[email protected]",
"accepted_currencies": ["DDSC"],
"refund_policy": "Description of your refund policy"
}
)
Registration Best Practices:
To update your merchant store details after registration:
update_merchant(
name="Updated Store Name",
description="Updated description",
metadata={...updated fields...}
)
Update your profile when:
To create a checkout for a buyer, use the create_checkout MCP tool:
create_checkout(
amount="<amount_in_ddsc>",
description="Description of what the buyer is purchasing",
metadata={
"order_id": "unique-order-id",
"product": "Name of the service or product",
"buyer_reference": "Optional reference for the buyer"
}
)
This returns:
checkout_id (unique identifier for this checkout session)checkout_url (URL the buyer visits to complete payment)status (initially "pending")Checkout Amount Rules:
After creating a checkout, monitor its status:
get_checkout(checkout_id="<checkout_id>")
Possible statuses:
pending - Checkout created, awaiting buyer payment.paid - Buyer has completed payment. Funds are held in the merchant contract.expired - Checkout was not completed within the time window (typically 24 hours).cancelled - Checkout was explicitly cancelled by the merchant.When a checkout transitions to paid:
When a checkout expires:
Every checkout that receives payment becomes an order. Track orders through these stages:
Order Created (checkout paid)
|
v
Order In Progress (work being performed)
|
v
Order Completed (deliverable sent to buyer)
|
v
Order Closed (buyer confirmed receipt / rating received)
To retrieve all orders for your merchant store:
list_merchant_orders(
status="all|pending|in_progress|completed|closed",
limit=50,
offset=0
)
As you work on fulfilling an order, update its status:
update_order(
order_id="<order_id>",
status="in_progress|completed|closed",
notes="Optional notes about the order progress"
)
Status Update Guidelines:
in_progress immediately when you start working on the order.completed only when the deliverable is fully ready and sent to the buyer.closed after the buyer acknowledges receipt or after a reasonable time window (e.g., 7 days with no dispute).Provide buyers with their order status when asked:
checkout_id or order_id.Before withdrawing, check your accumulated balance:
get_merchant_balance()
This returns:
available_balance - DDSC that can be withdrawn immediately.pending_balance - DDSC from recent checkouts that may still be in a hold period.total_earned - Lifetime total DDSC earned through the merchant store.To withdraw DDSC from your merchant contract to your wallet:
withdraw_merchant_funds(
amount="<amount_in_ddsc>"
)
Withdrawal Rules:
available_balance.For autonomous agents, the recommended strategy is Threshold Withdrawal with a threshold of 100 DDSC. This balances liquidity with operational simplicity.
Generate checkout URLs that can be shared via any channel:
generate_checkout_url(
amount="<amount_in_ddsc>",
description="What the buyer gets",
redirect_url="https://your-site.com/thank-you",
metadata={
"product_id": "prod-123",
"campaign": "launch-promo"
}
)
This returns a fully-formed URL like: