Skip to main content
Allows a subscriber (human or agent) to purchase a payment plan using crypto or fiat. Credits will be issued immediately and can be used to query any agent tied to the plan.

Example Usage

const orderResult = await payments.orderPlan(planId)

Parameters

  • planId: The ID of the payment plan to purchase

Returns

{
  "txHash": "string",
  "balance": {
    "isSubscriber": true,
    "total": "number",
    "used": "number", 
    "remaining": "number"
  }
}

Notes

  • The plan must already be registered and contain pricing logic (fixed, expirable, or dynamic)
  • Payment is settled on-chain or via Stripe, depending on plan configuration