Customer Summary
Generate a report of transactions within a specified time range.
POST v1/reports/customers
curl https://api.sphere.net/v1/reports/customers \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"format": "json",
"language": "es", // optional, defaults to "en"
"filters": { // optional, defaults to all customers
"limit": 20, // defaults to 100
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-31T23:59:59Z",
"region": ["USA", "europe"],
"status": ["active", "inactive"]
}
}'
Response
{
"ok": true,
"object": "object",
"statusCode": 200,
"error": null,
"message": "success",
"data": {
"id": "report_123",
"state": "processing",
"type": "customer_summary",
"format": "json",
"language": "es",
"filters": {
"limit": 20,
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-31T23:59:59Z",
"region": ["USA", "europe"],
"status": ["active", "inactive"]
},
"donwloadUrl": null,
"expiresAt": null,
"createdAt": "2024-01-20T19:39:14.316Z",
"updatedAt": "2024-01-20T19:39:14.316Z"
},
"ts": "2024-08-22T16:15:42.707Z",
"request": "request_cdde26b2c0534183a1aaba6baebaec1f"
}
Once the report is ready, the response will include a download URL:
{
"ok": true,
"object": "object",
"statusCode": 200,
"error": null,
"message": "success",
"data": {
"id": "report_123",
"state": "processing",
"type": "customer_summary",
"format": "json",
"language": "es",
"filters": {
"limit": 20,
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-31T23:59:59Z",
"region": ["USA", "europe"],
"status": ["active", "inactive"]
},
"donwloadUrl": "https://api.sphere.net/v1/reports/report_123/download",
"expiresAt": "2024-01-27T19:39:14.316Z",
"createdAt": "2024-01-20T19:39:14.316Z",
"updatedAt": "2024-01-20T19:39:14.316Z"
},
"ts": "2024-08-22T16:15:42.707Z",
"request": "request_cdde26b2c0534183a1aaba6baebaec1f"
}