Create subscription plan
Create subscription plan
POST /api/subscription-plans
x-gateway-key: sk_live_...

{
  "planReference": "starter-monthly",
  "displayName": "Starter monthly",
  "amountRaw": "49000000",
  "periodSeconds": 2592000,
  "tokenMint": "accepted token address",
  "pullerWallet": "optional recurring collection wallet",
  "metadataUri": "https://app.example/plan.json"
}
Publish subscription plan transaction
Publish subscription plan transaction
POST /api/subscription-plans/{planId}/transactions/create-plan
x-gateway-key: sk_live_...

{
  "account": "business payout wallet"
}

Returns an unsigned base64 transaction for the business wallet to publish the Solana subscription plan.
Confirm subscription plan
Confirm subscription plan
POST /api/subscription-plans/{planId}/confirm
x-gateway-key: sk_live_...

{
  "signature": "solana transaction signature"
}

Verifies the create-plan transaction, marks the plan ACTIVE, and sends a signed subscription_plan.confirmed callback. Gateway reads the transaction at finalized commitment, about 13 seconds after it is sent; before that the request fails with a not-found error and should be retried.
Update on-chain plan transaction
Update on-chain plan transaction
POST /api/subscription-plans/{planId}/transactions/update-plan
x-gateway-key: sk_live_...

{
  "account": "business payout wallet",
  "onchainStatus": "sunset",
  "endTs": "1782000000"
}

Returns an unsigned base64 transaction for the business wallet to restore an on-chain plan or sunset it from new subscribers. Use "active" without endTs to restore the on-chain plan.
Use Gateway pause, resume, and archive endpoints to control whether the SaaS app offers the plan to new customers.
Confirm on-chain plan update
Confirm on-chain plan update
POST /api/subscription-plans/{planId}/confirm
x-gateway-key: sk_live_...

{
  "action": "update-plan",
  "signature": "solana transaction signature",
  "onchainStatus": "sunset",
  "endTs": "1782000000"
}

Verifies the update-plan transaction, records the signature, and sends a signed subscription_plan.updated_onchain callback. Use active without endTs to confirm an on-chain restore. Gateway reads the transaction at finalized commitment, about 13 seconds after it is sent; before that the request fails with a not-found error and should be retried.
The Gateway plan status is still controlled by pause, resume, and archive endpoints.
Pause subscription plan
Pause subscription plan
POST /api/subscription-plans/{planId}/pause
x-gateway-key: sk_live_...

Pauses an ACTIVE subscription plan. New customer subscriptions and collection workers should stop using a paused plan until it is resumed. Existing customer records remain stored in Gateway.
Resume subscription plan
Resume subscription plan
POST /api/subscription-plans/{planId}/resume
x-gateway-key: sk_live_...

Resumes a paused subscription plan so new customer subscriptions and due collection workers can use it again.
Archive subscription plan
Archive subscription plan
POST /api/subscription-plans/{planId}/archive
x-gateway-key: sk_live_...

Archives a subscription plan when the offer should no longer be sold. Archived plans stay available in records and reports, but new customer subscriptions and collection workers should stop using them.