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

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",
  "message": "Invalid request",
  "success": false
}
{
  "code": 401,
  "type": "Unauthorized",
  "statusMessage": "UNAUTHORIZED",
  "message": "Invalid token",
  "success": false
}