Initiate Subscription
π Initiate a New Subscription
Use this endpoint to start a new subscription process.
π§ Endpoint
POST /subscription/initiate
π₯ Request Body
Field | Type | Description |
---|---|---|
user | string | Identifier of the plan or service being subscribed to |
amount | float | Amount to be charged per cycle |
β Example Request (Mastercard)
{
"user_id": "email@example.com",
"amount": 19.99,
}
π€ Response
Returns a redirect URL to complete the payment.
β Example Success Response
{
"payment_url": "initiated",
"track_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8",
"success": "true",
}
β Error Responses
Provider Not Supported
{
"detail": "Payment provider not supported, payment provider: STRIPE"
}
Missing Configuration
{
"detail": "Mastercard access not found validate api_key and configurations, payment provider: MASTERCARD"
}