Initiate Subscription

πŸ”„ Initiate a New Subscription

Use this endpoint to start a new subscription process.

πŸ”§ Endpoint

POST /subscription/initiate

πŸ“₯ Request Body

FieldTypeDescription
userstringIdentifier of the plan or service being subscribed to
amountfloatAmount 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"
}