{
    "title": "Reporting APIs",
    "description": "Reporting APIs enable merchants to generate actionable reports about various aspects of their business. Through these APIs you gain access to precise data, enabling you to track revenue, monitor transaction volume, identify fraud, reconcile financial records, and make informed decisions for your business.",
    "endpoints": [
        {
            "fragment": "Fetch Settlement Reports",
            "method": "GET",
            "link": "API_URL/partners/:partnerId/merchants/:merchantId/reports"
        }
    ],
    "apis": [
        {
            "heading": "Fetch Settlement Reports",
            "description": "Retrieves the list of settlement reports for a merchant. Use this API to get a summary of the merchant’s settled transactions within a specific time frame, which can be daily or monthly depending on the report type opted for the merchant.",
            "pagination": true,
            "reqParams": [],
            "resParams": [
                {
                    "name": "status",
                    "type": "string",
                    "description": "Status of the request, indicated as either 'SUCCESS' or 'ERROR'."
                },
                {
                    "name": "data",
                    "type": "array",
                    "description": "Response data",
                    "resParams": [
                        {
                            "name": "payoutId",
                            "type": "String",
                            "description": "The payout ID used to identify a specific payout."
                        },
                        {
                            "name": "merchantId",
                            "type": "String",
                            "description": "The merchant ID of the merchant for which the settlement report is generated."
                        },
                        {
                            "name": "transactionStartDate",
                            "type": "String",
                            "description": "The date of the first transaction in the generated settlement report, in YYYY-MM-DD format."
                        },
                        {
                            "name": "transactionEndDate",
                            "type": "String",
                            "description": "The date of the last transaction in the generated settlement report, in YYYY-MM-DD format."
                        },
                        {
                            "name": "settlementDate",
                            "type": "String",
                            "description": "Date of the payout, in YYYY-MM-DD format."
                        },
                        {
                            "name": "reportType",
                            "type": "String",
                            "description": "Specifies the type of settlement report opted for the merchant. It can be either 'MONTHLY' or 'DAILY’."
                        },
                        {
                            "name": "url",
                            "type": "String",
                            "description": "URL from which the particular settlement report can be viewed."
                        },
                        {
                            "name": "totalSale",
                            "type": "Number",
                            "description": "The total amount of sales generated by the merchant during the report period."
                        },
                        {
                            "name": "totalRefund",
                            "type": "Number",
                            "description": "The total amount refunded by the merchant during the specified time period."
                        },
                        {
                            "name": "fee",
                            "type": "Number",
                            "description": "The total fee collected from transactions during the settlement."
                        },
                        {
                            "name": "payout",
                            "type": "Number",
                            "description": "The final amount paid out to the merchant after all deductions."
                        }
                    ]
                },
                {
                    "name": "message",
                    "type": "string",
                    "description": "A message that describes the status of the request."
                }
            ],
            "method": "GET",
            "path": "/partners/:partnerId/merchants/:merchantId/reports",
            "examples": {
                "request": {
                    "headers": [
                        {
                            "name": "Content-Type",
                            "value": "application/json"
                        },
                        {
                            "name": "API-KEY",
                            "value": "YOUR_API_KEY"
                        },
                        {
                            "name": "API-SECRET",
                            "value": "YOUR_API_SECRET"
                        },
                        {
                            "name": "MERCHANT-ID",
                            "value": "YOUR_MERCHANT_ID"
                        }
                    ]
                },
                "response": [
                    {
                        "code": 200,
                        "response": "\n{\n\t\"status\": \"SUCCESS\",\n\t\"data\": [\n\t\t{\n\t\t\t\"payoutId\": \"Q6z2e0goIOE4DXD0VYiT\",\n\t\t\t\"merchantId\": \"8149bdef0a2300090e\",\n\t\t\t\"transactionStartDate\": \"2023-08-07\",\n\t\t\t\"transactionEndDate\": \"2023-08-07\",\n\t\t\t\"settlementDate\": \"2023-08-08\",\n\t\t\t\"reportType\": \"DAILY\",\n\t\t\t\"url\": \"https://reports.surfboardpayments.com/settlementReport1.pdf\",\n\t\t\t\"totalSale\": 10000,\n\t\t\t\"totalRefund\": 100,\n\t\t\t\"fee\": 200,\n\t\t\t\"payout\": 9700\n\t\t\t\n\t\t},\n\t\t{\n\t\t\t\"payoutId\": \"Q6z2e0goIOE4DXD0VYiT\",\n\t\t\t\"merchantId\": \"8149bdef0a2300090e\",\n\t\t\t\"transactionStartDate\": \"2023-08-07\",\n\t\t\t\"transactionEndDate\": \"2023-08-07\",\n\t\t\t\"settlementDate\": \"2023-08-08\",\n\t\t\t\"reportType\": \"DAILY\",\n\t\t\t\"url\": \"https://reports.surfboardpayments.com/settlementReport2.pdf\",\n\t\t\t\"totalSale\": 10000,\n\t\t\t\"totalRefund\": 100,\n\t\t\t\"fee\": 200,\n\t\t\t\"payout\": 9700\n\t\t}\n\t],\n\t\"message\": \"Settlement reports fetched successfully\"\n}"
                    }
                ]
            }
        }
    ]
}