Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Fireinthebellyy/ftb-web/llms.txt

Use this file to discover all available pages before exploring further.

The Toolkits API allows you to manage educational content, create toolkits, and handle purchases with Razorpay integration.

Authentication

  • GET /api/toolkits: Public endpoint
  • GET /api/toolkits/: Public endpoint (shows additional info for authenticated users)
  • POST /api/toolkits: Admin only
  • POST /api/toolkits/: Requires authentication (for purchases)

List Toolkits

curl -X GET "https://ftbhustle.com/api/toolkits"
Retrieve all active toolkits.

Response

array
array
Array of toolkit objects
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "title": "Complete Web Development Course",
    "description": "Master web development from scratch",
    "price": 1999,
    "originalPrice": 2999,
    "coverImageUrl": "https://example.com/cover.jpg",
    "videoUrl": "https://youtube.com/watch?v=xyz",
    "contentUrl": null,
    "category": "Skills",
    "highlights": [
      "15 video lessons",
      "Lifetime access",
      "Certificate of completion"
    ],
    "totalDuration": "5h 30m",
    "lessonCount": 15,
    "isActive": true,
    "showSaleBadge": true,
    "userId": "creator123",
    "creatorName": "John Doe",
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-03-01T14:30:00Z"
  }
]

Get Single Toolkit

curl -X GET "https://ftbhustle.com/api/toolkits/550e8400-e29b-41d4-a716-446655440000" \
  -H "Cookie: session=YOUR_SESSION_TOKEN"
Retrieve detailed information about a specific toolkit, including content items and purchase status.

Path Parameters

id
string
required
The unique identifier of the toolkit

Response

toolkit
object
The toolkit object with all details
contentItems
array
Array of content items in the toolkit
hasPurchased
boolean
Whether the current user has purchased this toolkit
completedItemIds
array
Array of content item IDs the user has completed
{
  "toolkit": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "title": "Complete Web Development Course",
    "description": "Master web development from scratch",
    "price": 1999,
    "originalPrice": 2999,
    "coverImageUrl": "https://example.com/cover.jpg",
    "videoUrl": "https://youtube.com/watch?v=xyz",
    "contentUrl": null,
    "category": "Skills",
    "highlights": ["15 video lessons", "Lifetime access"],
    "totalDuration": "5h 30m",
    "lessonCount": 15,
    "isActive": true,
    "userId": "creator123",
    "creatorName": "John Doe",
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-03-01T14:30:00Z"
  },
  "contentItems": [
    {
      "id": "item-1",
      "toolkitId": "550e8400-e29b-41d4-a716-446655440000",
      "title": "Introduction to HTML",
      "type": "video",
      "content": null,
      "bunnyVideoUrl": "https://cdn.bunny.net/video123",
      "orderIndex": 0,
      "createdAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-01-15T10:00:00Z"
    }
  ],
  "hasPurchased": true,
  "completedItemIds": ["item-1"]
}

Create Toolkit

curl -X POST "https://ftbhustle.com/api/toolkits" \
  -H "Cookie: session=YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "New Course",
    "description": "Learn something new",
    "price": 999,
    "originalPrice": 1499,
    "category": "Skills",
    "lessonCount": 10,
    "totalDuration": "3h 00m"
  }'
Create a new toolkit. Admin only.

Request Body

title
string
required
Toolkit title
description
string
required
Detailed description
price
number
required
Price in rupees
originalPrice
number
Original price (for discounts)
coverImageUrl
string
Cover image URL
videoUrl
string
YouTube promo video URL
contentUrl
string
Content page URL (legacy)
category
string
Category name
highlights
array
Array of feature highlights
totalDuration
string
Total duration
lessonCount
number
Number of lessons
showSaleBadge
boolean
Show sale badge

Response

object
object
The created toolkit object
{
  "id": "550e8400-e29b-41d4-a716-446655440001",
  "title": "New Course",
  "description": "Learn something new",
  "price": 999,
  "originalPrice": 1499,
  "coverImageUrl": null,
  "videoUrl": null,
  "contentUrl": null,
  "category": "Skills",
  "highlights": null,
  "totalDuration": "3h 00m",
  "lessonCount": 10,
  "isActive": false,
  "showSaleBadge": null,
  "userId": "admin123",
  "createdAt": "2024-03-15T14:30:00Z",
  "updatedAt": "2024-03-15T14:30:00Z"
}

Purchase Toolkit

curl -X POST "https://ftbhustle.com/api/toolkits/550e8400-e29b-41d4-a716-446655440000" \
  -H "Cookie: session=YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "couponCode": "SAVE100"
  }'
Initiate a toolkit purchase with optional coupon code. Returns Razorpay order details for payment.

Path Parameters

id
string
required
The unique identifier of the toolkit to purchase

Request Body

couponCode
string
Optional coupon code for discount

Response

success
boolean
Indicates if the purchase initiation was successful
free
boolean
Whether the purchase is free (fully covered by coupon)
order
object
Razorpay order details (not present if free=true)
key
string
Razorpay key ID for frontend integration
purchase
object
Purchase record details
toolkit
object
The toolkit being purchased
discountAmount
number
Discount applied in rupees
finalPrice
number
Final price after discount in rupees
{
  "success": true,
  "free": false,
  "order": {
    "id": "order_ABC123XYZ",
    "amount": 189900,
    "currency": "INR"
  },
  "key": "rzp_live_XXXXXXXXXX",
  "purchase": {
    "id": "purchase-id-123",
    "userId": "user123",
    "toolkitId": "550e8400-e29b-41d4-a716-446655440000",
    "razorpayOrderId": "order_ABC123XYZ",
    "paymentStatus": "pending",
    "amountPaid": 189900,
    "couponId": "coupon-id-456",
    "createdAt": "2024-03-15T14:30:00Z"
  },
  "toolkit": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "title": "Complete Web Development Course",
    "price": 1999
  },
  "discountAmount": 100,
  "finalPrice": 1899
}

Coupon Validation Errors

error
string
Error message for coupon issues
Possible coupon error responses (400 Bad Request):
  • Invalid coupon code: Coupon does not exist
  • Coupon is not active: Coupon has been deactivated
  • Coupon has expired: Coupon expiration date has passed
  • You have already used this coupon: User has reached per-user limit
  • Coupon usage limit reached: Total usage limit reached
  • Toolkit already purchased: User already owns this toolkit

Error Responses

All API endpoints return appropriate HTTP status codes:
  • 401 Unauthorized: User is not authenticated (where required)
  • 403 Forbidden: User doesn’t have admin privileges
  • 404 Not Found: Toolkit not found
  • 400 Bad Request: Validation error or coupon issue
  • 500 Internal Server Error: Server error
Error Response Example
{
  "error": "Failed to fetch toolkit"
}