Skip to main content
POST
/
plan
/
{planId}
/
order
Order Plan
curl --request POST \
  --url http://sandbox.mintlify.com/plan/{planId}/order \
  --header 'Authorization: Bearer <token>'
{
  "txHash": "<string>",
  "balance": {
    "isSubscriber": true,
    "total": 123,
    "used": 123,
    "remaining": 123
  }
}
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

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

planId
string
required

The unique identifier of the plan to order

Response

200 - application/json

Order successful

txHash
string
balance
object