Permission required:
subscription:manageQuery Parameters
integer
required
The plan to price a switch to
Response
object
Errors
Errors answer withsuccess: false, a message and an error_code. See Error Codes for every code.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl -X GET 'https://app.memorylake.ai/openapi/memorylake/admin/v1/billing/subscription/plan-change-preview?plan_id=9e50b1aed525a8280e28b9662b6a7ba0' \
-H 'Authorization: Bearer sk_xxxxxx'
{
"success": true,
"message": "Operation completed successfully",
"data": {
"applicable": false,
"lines": [
{
"amount": {
"amount": 1999,
"currency": "usd"
},
"description": "Example description",
"proration": false,
"period_end": 1760000000,
"period_start": 1760000000
}
],
"plan_id": 1,
"amount_due": {
"amount": 1999,
"currency": "usd"
},
"effective_at": 1760000000,
"from_plan": {
"id": 1,
"name": "Example name"
},
"next_invoice": {
"amount": {
"amount": 1999,
"currency": "usd"
},
"date": 1
},
"proration_date": 1,
"reason": "no_paid_subscription",
"to_plan": {
"id": 1,
"name": "Example name"
}
}
}
Prices switching the subscription to plan_id without changing anything: the prorated amount charged now, its line items, when the change takes effect and the next full invoice
curl -X GET 'https://app.memorylake.ai/openapi/memorylake/admin/v1/billing/subscription/plan-change-preview?plan_id=9e50b1aed525a8280e28b9662b6a7ba0' \
-H 'Authorization: Bearer sk_xxxxxx'
{
"success": true,
"message": "Operation completed successfully",
"data": {
"applicable": false,
"lines": [
{
"amount": {
"amount": 1999,
"currency": "usd"
},
"description": "Example description",
"proration": false,
"period_end": 1760000000,
"period_start": 1760000000
}
],
"plan_id": 1,
"amount_due": {
"amount": 1999,
"currency": "usd"
},
"effective_at": 1760000000,
"from_plan": {
"id": 1,
"name": "Example name"
},
"next_invoice": {
"amount": {
"amount": 1999,
"currency": "usd"
},
"date": 1
},
"proration_date": 1,
"reason": "no_paid_subscription",
"to_plan": {
"id": 1,
"name": "Example name"
}
}
}
GET /openapi/memorylake/admin/v1/billing/subscription/plan-change-preview
subscription:managecurl -X GET 'https://app.memorylake.ai/openapi/memorylake/admin/v1/billing/subscription/plan-change-preview?plan_id=9e50b1aed525a8280e28b9662b6a7ba0' \
-H 'Authorization: Bearer sk_xxxxxx'
Show Plan Change Preview object
Show Plan Change Preview Line object
{
"success": true,
"message": "Operation completed successfully",
"data": {
"applicable": false,
"lines": [
{
"amount": {
"amount": 1999,
"currency": "usd"
},
"description": "Example description",
"proration": false,
"period_end": 1760000000,
"period_start": 1760000000
}
],
"plan_id": 1,
"amount_due": {
"amount": 1999,
"currency": "usd"
},
"effective_at": 1760000000,
"from_plan": {
"id": 1,
"name": "Example name"
},
"next_invoice": {
"amount": {
"amount": 1999,
"currency": "usd"
},
"date": 1
},
"proration_date": 1,
"reason": "no_paid_subscription",
"to_plan": {
"id": 1,
"name": "Example name"
}
}
}
success: false, a message and an error_code. See Error Codes for every code.
| Status | Meaning |
|---|---|
400 | A parameter or the body is invalid |
401 | The API key is missing, invalid, disabled or expired |
403 | The key is not allowed to do this |
409 | The request conflicts with the current state, e.g. a duplicate or a limit reached |
422 | The body or a parameter failed validation |
429 | Too many requests. Wait for the time in Retry-After |
500 | Server-side error |
503 | Temporarily unavailable. Retry later |