Create subscription plan
Creates a recurring-payment subscription plan record. This stores SDP backend state and Solana subscriptions program identifiers; it does not by itself create the on-chain plan.
Headers
Selects the active project for this request. Required for session/dashboard callers. Ignored when authenticating with an API key, whose scope is fixed to the key's project.
Selects the active project for this request. Required for session/dashboard callers. Ignored when authenticating with an API key, whose scope is fixed to the key's project.
Request body
Example request
{
"ownerWalletId": "wal_merchant",
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "25.00",
"periodHours": 720,
"programPlanId": "17014118346046923173",
"planPda": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"destinationAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"pullerWalletId": "wal_collector",
"metadataUri": "https://example.com/subscriptions/monthly-usdc.json",
"status": "active"
}Response
Subscription plan created
Example response
{
"data": {
"subscriptionPlan": {
"id": "psp_example",
"organizationId": "org_example",
"projectId": "prj_example",
"ownerWalletId": "privy_wallet_123",
"ownerAddress": "So11111111111111111111111111111111111111112",
"amount": "100.00",
"periodHours": 720,
"programPlanId": "17014118346046923173",
"planPda": "So11111111111111111111111111111111111111112",
"destinationAddress": "So11111111111111111111111111111111111111112",
"pullerWalletId": "privy_wallet_123",
"pullerAddress": "So11111111111111111111111111111111111111112",
"status": "active",
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z"
}
},
"meta": {
"requestId": "req_example",
"timestamp": "2025-01-01T00:00:00.000Z"
}
}Changes
Changed in 1 of the 9 revisions of this API.6
- ●
added the new
SERVICE_UNAVAILABLEenum value to theerror/coderesponse property for the response status400response-property-enum-value-added
- ●
added the new
SERVICE_UNAVAILABLEenum value to theerror/coderesponse property for the response status401response-property-enum-value-added
- ●
added the new
SERVICE_UNAVAILABLEenum value to theerror/coderesponse property for the response status403response-property-enum-value-added
- ●
added the new
SERVICE_UNAVAILABLEenum value to theerror/coderesponse property for the response status404response-property-enum-value-added
- ●
added the new
SERVICE_UNAVAILABLEenum value to theerror/coderesponse property for the response status409response-property-enum-value-added
- ●
added the new
SERVICE_UNAVAILABLEenum value to theerror/coderesponse property for the response status500response-property-enum-value-added
- ●