TagMangoTagMango Docs
Subscription

Grant Subscription Access

POST
/api/v1/external/subscriptions/grant

Activate or reactivate an existing subscription without payment. Provide either subscriptionId OR userId + mangoId to identify the subscription. Returns 404 if not found, 409 if already active.

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

application/json

curl -X POST "https://api-prod-new.tagmango.com/api/v1/external/subscriptions/grant" \  -H "x-whitelabel-host: string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "_id": "66a1390268a76f2f5c9f39a3",
  "fan": "66a1390268a76f2f5c9f39a3",
  "creator": "66a1390268a76f2f5c9f39a3",
  "mango": "66a1390268a76f2f5c9f39a3",
  "subscribedAt": "2024-08-11T10:20:30Z",
  "latestSubscriptionDate": "2024-08-11T10:20:30Z",
  "expiredAt": "2024-08-11T10:20:30Z",
  "paymentProvider": "Razorpay",
  "status": "active",
  "orders": [
    "66a1390268a76f2f5c9f39a3",
    "77b2390268a76f2f5c9f39a4"
  ],
  "acquisitionType": "organic",
  "isFree": true,
  "amount": 1000,
  "isLifetime": false,
  "createdAt": "2024-11-04T13:05:43.799Z",
  "updatedAt": "2024-11-04T13:05:43.799Z",
  "isReactivation": false
}
{
  "code": 400,
  "type": "Bad Request",
  "statusMessage": "BAD_REQUEST",
  "errorCode": "SELF_OPERATION_NOT_ALLOWED",
  "message": "Creators and Team members (UAM) cannot perform subscription actions on themselves.",
  "result": "Creators and Team members (UAM) cannot perform subscription actions on themselves.",
  "success": false
}
{
  "code": 401,
  "type": "Unauthorized",
  "statusMessage": "UNAUTHORIZED",
  "message": "Invalid token",
  "success": false
}
{
  "code": 403,
  "type": "Forbidden",
  "statusMessage": "FORBIDDEN",
  "errorCode": "MANGO_CREATOR_MISMATCH",
  "message": "The mango exists but is owned by a different creator than the queried creator",
  "result": "The mango exists but is owned by a different creator than the queried creator",
  "success": false
}
{
  "code": 404,
  "type": "Not Found",
  "statusMessage": "NOT_FOUND",
  "errorCode": "SUBSCRIPTION_NOT_FOUND",
  "message": "No subscription matching found for user and mango combination.",
  "result": "No subscription matching found for user and mango combination.",
  "success": false
}
{
  "code": 409,
  "type": "Conflict",
  "statusMessage": "CONFLICT",
  "errorCode": "SUBSCRIPTION_ALREADY_ACTIVE",
  "message": "The subscription is already in an active state and cannot be activated again.",
  "result": "The subscription is already in an active state and cannot be activated again.",
  "success": false
}