curl -X POST https://api.vaniykempire.com/api/payments/create-payment-intent \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contentId": "507f1f77bcf86cd799439011"
}'
{
"clientSecret": "pi_3MtwBwLkdIwHu7ix28a3tqPa_secret_YrKJUKribcBjcG8HVhfZluoGH",
"amount": 29.99
}
Create a Stripe payment intent for purchasing content
curl -X POST https://api.vaniykempire.com/api/payments/create-payment-intent \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contentId": "507f1f77bcf86cd799439011"
}'
{
"clientSecret": "pi_3MtwBwLkdIwHu7ix28a3tqPa_secret_YrKJUKribcBjcG8HVhfZluoGH",
"amount": 29.99
}
Creates a Stripe payment intent to initiate the payment flow for content purchase. This endpoint verifies the content exists, checks for duplicate purchases, and creates a pending purchase record.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/PhemiT/vaniykeempire-api/llms.txt
Use this file to discover all available pages before exploring further.
contentId - The MongoDB ObjectId of the contentuserId - The MongoDB ObjectId of the purchasing usercontentTitle - The title of the content being purchasedcontentIdclientSecret to complete payment/api/payments/webhookcompletedpublishedcurl -X POST https://api.vaniykempire.com/api/payments/create-payment-intent \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contentId": "507f1f77bcf86cd799439011"
}'
{
"clientSecret": "pi_3MtwBwLkdIwHu7ix28a3tqPa_secret_YrKJUKribcBjcG8HVhfZluoGH",
"amount": 29.99
}
| Status Code | Description |
|---|---|
| 200 | Payment intent created successfully |
| 400 | Content already purchased by user |
| 401 | Not authenticated |
| 404 | Content not found or not published |
| 500 | Server error or Stripe API error |
completed via webhook when payment succeedssrc/controllers/paymentController.js:6-61