Change User Plan
Please use this (https://blkem.com/mobile_api/change_user_plan) API to change user's plan
Post parameters
Field | Value | Remarks |
---|---|---|
session_id | ​Access token ID | E.g. de25cc16eb00960f076... |
plan_id | Plan | E.g. 1 |
pm_id | Payment Method ID (required for stripe) | E.g. 1 |
method | Payment Method (default: stripe) | ('stripe' or 'paypal') |
Success response
{
"code": 200,
"data": {
"id": 17,
"plan_id": 28,
"time": "2022-01-21 17:24:04",
"expiry": "2022-02-20 17:24:04",
"user_id": 6098,
"active": 1
},
"message": "Your plan has been updated to Monthly"
}
{
"code": 200,
"data": {
"id": 4,
"plan_id": 9,
"time": "2023-02-15 17:56:09",
"expiry": "2023-03-18 17:56:09",
"cancelled_time": null,
"user_id": 6098,
"price": null,
"subscription_id": "I-FRLNNJ401N3F",
"payment_method": "paypal",
"active": 0,
"plan": {
"id": 9,
"name": "asd",
"frequency": "monthly",
"price": 23,
"sub_title": "asd1",
"disclaimer": null,
"paypal_plan_id": "P-8VK99020029147116MPWRB6Q",
"active": 1
}
},
"approval_link": "https://www.sandbox.paypal.com/webapps/billing/subscriptions?ba_token=BA-2D504591E7868033W",
"message": "Use the link to make subscription complete"
}
Error responses
{
"code": 401,
"data": [],
"message": "Unauthorized Access"
}
{
"code": 400,
"message": "Failed to charge payment"
}
{
"code": 400,
"message": "Failed to cancel previous plan"
}
{
"code": 400,
"message": "No payment method found"
}
{
"code": 400,
"message": "Payment method not found"
}