Authorizations
Body
application/json
API Request Body
Response
200 - application/json
API Response Body
curl --request POST \
--url https://backend.codedamn.com/api/public/get-sales-data \
--header 'Content-Type: application/json' \
--header 'FERMION-API-KEY: <api-key>' \
--data '{
"data": [
{
"data": {
"from": "<string>",
"to": "<string>",
"groupBy": "week",
"timezone": "<string>",
"shouldIncludeBreakdown": true,
"productTypeFilter": [
"FermionDigitalProduct"
],
"paymentStatusFilter": [
"Valid"
]
}
}
]
}'
[
{
"output": {
"status": "ok",
"data": {
"summary": {
"totalRevenueInrPaise": 123,
"totalSalesCount": 123,
"averageSaleValueInrPaise": 123,
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z"
},
"revenueByPeriod": [
{
"period": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"totalRevenuePaise": 123,
"salesCount": 123,
"breakdown": [
{
"productType": "Course",
"revenuePaise": 123,
"salesCount": 123
}
]
}
],
"topProducts": [
{
"productId": "<string>",
"productName": "<string>",
"productType": "Course",
"totalRevenuePaise": 123,
"salesCount": 123
}
]
}
}
}
]
Get sales data with revenue breakdown, filtered by month/week. This is a public API that requires a fermion API key.
Authentication with the “FERMION-API-KEY” header is required to use this endpoint.
Rate limit: Maximum 30 requests in a window of 1m.
curl --request POST \
--url https://backend.codedamn.com/api/public/get-sales-data \
--header 'Content-Type: application/json' \
--header 'FERMION-API-KEY: <api-key>' \
--data '{
"data": [
{
"data": {
"from": "<string>",
"to": "<string>",
"groupBy": "week",
"timezone": "<string>",
"shouldIncludeBreakdown": true,
"productTypeFilter": [
"FermionDigitalProduct"
],
"paymentStatusFilter": [
"Valid"
]
}
}
]
}'
[
{
"output": {
"status": "ok",
"data": {
"summary": {
"totalRevenueInrPaise": 123,
"totalSalesCount": 123,
"averageSaleValueInrPaise": 123,
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z"
},
"revenueByPeriod": [
{
"period": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"totalRevenuePaise": 123,
"salesCount": 123,
"breakdown": [
{
"productType": "Course",
"revenuePaise": 123,
"salesCount": 123
}
]
}
],
"topProducts": [
{
"productId": "<string>",
"productName": "<string>",
"productType": "Course",
"totalRevenuePaise": 123,
"salesCount": 123
}
]
}
}
}
]
API Request Body
Show child attributes
API Response Body
Show child attributes