OrbitDocs

Create a plan

POST /plans creates a recurring plan owned by a merchant.

POST/plans

Body

merchant_iduuidrequired

Merchant that owns the plan. Must be a valid UUID.

namestringrequired

Shown at checkout, for example Pro Monthly. Cannot be empty or only spaces.

usdc_amountnumberrequired

Raw token units (7 decimals). 290000000 = 29 USDC. Must be greater than 0.

interval_secondsintegerrequired

Minimum gap between pulls. 2592000 = 30 days. Must be a whole number greater than 0.

Request

curl -X POST http://localhost:3001/plans \
  -H "Content-Type: application/json" \
  -d '{
    "merchant_id": "3f0c6a1e-5b7d-4e2a-9c8f-1d2e3f4a5b6c",
    "name": "Pro Monthly",
    "usdc_amount": 290000000,
    "interval_seconds": 2592000
  }'

Response 201

{
  "message": "Plan created successfully",
  "plan": {
    "id": "7c1e2d4a-0f6b-4a8e-9d51-3b2c9a1f6e20",
    "merchant_id": "3f0c6a1e-5b7d-4e2a-9c8f-1d2e3f4a5b6c",
    "name": "Pro Monthly",
    "usdc_amount": 290000000,
    "interval_seconds": 2592000,
    "created_at": "2026-09-25T10:00:00Z"
  }
}

Errors

StatusWhen
400A field is missing or breaks one of the rules above. See validation errors
500Database error, for example a merchant_id that does not exist

On this page