POST
/
public
/
get-sales-data
Get sales data with filtering
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
          }
        ]
      }
    }
  }
]

Authorizations

FERMION-API-KEY
string
header
required

Body

application/json

API Request Body

data
object[]
required

Response

200 - application/json

API Response Body

output
object
required