TagMangoTagMango Docs
Mango

Create Mango

POST
/api/v1/external/mangos

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:

  • free type must not include price, differentialPricing, or includeGST.
  • recurring type requires recurringType (monthly, quarterly, halfyearly, yearly).
  • onetime type must not include recurringType.
  • HTML tags are stripped from title and description.
AuthorizationBearer <token>

In: header

Header Parameters

x-whitelabel-host*string

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
}