Plans & checkout
Sell a feature and settle directly to the provider’s wallet.
Define a plan
| Field | Example |
|---|---|
| feature | ocr |
| name | 100 document credits |
| amount | 10.00 USDC |
| credits | 100 |
| ttl_seconds | 2592000 seconds of access |
| merchant_wallet | The provider wallet receiving the customer payment. |
| interval | once for a single purchase; month for an explicit payer-authorized, fixed 30-day subscription. |
Open a checkout session
Create a session server-side for a plan and holder. The checkout page lets the customer connect a wallet, transfer the exact token amount, and confirm the payment. Successful confirmation creates the grant.
const { session } = await bagseven.createCheckoutSession({
plan_id: "your-plan-id",
holder: "customer-123",
billing_email: "customer@example.com",
expires_in: 3600,
});
// Open this on your deployed console origin:
const checkout = new URL("/checkout", consoleOrigin);
checkout.searchParams.set("session", session.id);Human checkout does not inherit the MCP worker and needs no deployed agent mandate. Supply worker_id only when access must be bound to a registered worker. Prepaid consumption still checks its holder, binding, expiry and credits.
Direct settlement and platform fees
The customer’s payment goes to the provider’s merchant wallet. Bagseven records a platform fee of 0.1% per payment as a separate amount owed by the provider. It is not deducted from the provider’s payment or added as an automatic split transfer.
The platform records fee liability. Automated fee invoice collection is not implemented by the checkout flow.
Payment evidence
Confirmation checks a successful receipt, the configured token contract, the provider recipient, the paying wallet, the amount, and required confirmations. The paying wallet also signs payment authorization. Reusing a transaction for another checkout is rejected.