Create Mango
Create a new service (mango) for the creator.
Types: onetime (single purchase), recurring (subscription), free (no payment).
Pricing: Base price in creator's currency. For INR creators, minimum is ₹50. When differentialPricing is omitted, USD/EUR prices are auto-converted using real-time exchange rates.
Validation rules:
freetype must not includeprice,differentialPricing, orincludeGST.recurringtype requiresrecurringType(monthly, quarterly, halfyearly, yearly).onetimetype must not includerecurringType.- HTML tags are stripped from
titleanddescription.
Authorization
bearer In: header
Header Parameters
Host name of the dashboard, ex: mydomain.tagmango.com
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api-prod-new.tagmango.com/api/v1/external/mangos" \ -H "x-whitelabel-host: string" \ -H "Content-Type: application/json" \ -d '{ "title": "Premium Fitness Course", "description": "A 12-week fitness transformation program.", "type": "onetime" }'{
"_id": "66a1390268a76f2f5c9f39a3",
"creator": "77b2390268a76f2f5c9f39a4",
"title": "Introduction to Coding",
"price": 500,
"currency": "USD",
"inrAmount": 500,
"usdAmount": 6,
"eurAmount": 5,
"description": "This is a comprehensive guide to coding.",
"isHidden": false,
"isDeleted": false,
"recurringType": "MONTHLY",
"isPublic": false,
"isFree": true,
"affiliateEnabled": true,
"zeroCostMango": false,
"createdAt": "2024-08-11T10:20:30Z",
"updatedAt": "2024-08-11T10:20:30Z",
"coverContents": [
"https://linktoimage.com/image.jpg",
"https://linktoimage.com/video.mp4"
]
}{
"code": 400,
"type": "Bad Request",
"statusMessage": "BAD_REQUEST",
"errorCode": "MANGO_TITLE_RESERVED",
"message": "The title \"public\" is reserved and cannot be used as a mango name.",
"result": "The title \"public\" is reserved and cannot be used as a mango name.",
"success": false
}{
"code": 401,
"type": "Unauthorized",
"statusMessage": "UNAUTHORIZED",
"message": "Invalid token",
"success": false
}{
"code": 403,
"type": "Forbidden",
"statusMessage": "FORBIDDEN",
"errorCode": "MANGO_USER_NOT_CREATOR",
"message": "The user has not completed creator onboarding or is not on a host platform that allows mango creation.",
"result": "The user has not completed creator onboarding or is not on a host platform that allows mango creation.",
"success": false
}{
"code": 404,
"type": "Not Found",
"statusMessage": "NOT_FOUND",
"errorCode": "MANGO_CREATOR_NOT_FOUND",
"message": "The creator associated with the API key does not exist.",
"result": "The creator associated with the API key does not exist.",
"success": false
}