A customer's lifetime value, what it owes and its monthly revenue
const url = 'https://api.motenya.app/v1/products/example/insights/customer';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.motenya.app/v1/products/example/insights/customer \ --header 'Authorization: Bearer <token>'Pass contactId or clientId.
Requires crm:read.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Pass contactId or clientId.
Pass contactId or clientId.
Months of history, 1–36 (default 12).
Months of history, 1–36 (default 12).
Responses
Section titled “Responses”Success
Per currency, never converted. Paid means not canceled or refunded, and paid or with no payment status.
object
object
Unpaid or partly paid, counted in full.
object
object
Monthly recurring revenue of its active and past-due subscriptions.
object
Paid per month, oldest first; empty months are zero.
object
“YYYY-MM”, UTC.
Example generated
{ "lifetimeValue": [ { "currency": "example", "amount": "example" } ], "outstanding": [ { "currency": "example", "amount": "example" } ], "overdue": [ { "currency": "example", "amount": "example" } ], "orderCount": 1, "firstOrderAt": "example", "lastOrderAt": "example", "mrr": [ { "currency": "example", "amount": "example" } ], "monthly": [ { "month": "example", "currency": "example", "amount": "example" } ]}Invalid request
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing, invalid, revoked or expired API key
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing scope, API turned off, published article without publish scope, or account suspended
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Not found, or outside the knowledge bases this key may use
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Slug or translation already exists
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Rejected by validation (e.g. unknown language or category)
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Rate limited; see Retry-After
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Internal error