Get customer lifetime value
curl --request GET \
--url https://app.bily.ai/api/customer/v1/ad-metrics/{resourceUrl}/customer-ltv \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://app.bily.ai/api/customer/v1/ad-metrics/{resourceUrl}/customer-ltv', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.bily.ai/api/customer/v1/ad-metrics/{resourceUrl}/customer-ltv"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)[
{
"shop": "<string>",
"customer_id": "<string>",
"total_orders": 123,
"total_revenue": 123,
"avg_order_value": 123,
"first_order_date": "<string>",
"first_order_month": "<string>",
"last_order_date": "<string>",
"second_order_date": "<string>",
"total_refunds": 123,
"revenue_30d": 123,
"revenue_90d": 123,
"revenue_6m": 123,
"revenue_12m": 123,
"first_order_channel": "<string>",
"first_order_ad_id": "<string>",
"currency": "<string>",
"last_order_days_ago": 123,
"time_to_second_purchase_days": 123
}
]{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}Analytics
Get customer lifetime value
Returns store-scoped customer lifetime value, order cadence, attribution, and recency rows. Available only for Shopify resources; website requests return 400 with code resource_type_mismatch.
GET
/
ad-metrics
/
{resourceUrl}
/
customer-ltv
Get customer lifetime value
curl --request GET \
--url https://app.bily.ai/api/customer/v1/ad-metrics/{resourceUrl}/customer-ltv \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://app.bily.ai/api/customer/v1/ad-metrics/{resourceUrl}/customer-ltv', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.bily.ai/api/customer/v1/ad-metrics/{resourceUrl}/customer-ltv"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)[
{
"shop": "<string>",
"customer_id": "<string>",
"total_orders": 123,
"total_revenue": 123,
"avg_order_value": 123,
"first_order_date": "<string>",
"first_order_month": "<string>",
"last_order_date": "<string>",
"second_order_date": "<string>",
"total_refunds": 123,
"revenue_30d": 123,
"revenue_90d": 123,
"revenue_6m": 123,
"revenue_12m": 123,
"first_order_channel": "<string>",
"first_order_ad_id": "<string>",
"currency": "<string>",
"last_order_days_ago": 123,
"time_to_second_purchase_days": 123
}
]{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}Authorizations
ApiKeyAuthBearerAuth
Headers
Path Parameters
Query Parameters
Response
Request completed successfully.