<!-- ZenPays documentation · https://docs.zenpayz.com/docs/rest-api/endpoints/reports/get-report -->

# Get Report

Retrieve details of a specific report by ID.

<EndpointHeader verb="GET" path="/merchant/api/v1/reports/:id" />

## Request

### Headers

<ParamTable
  label="Header"
  rows={[
    { name: "Authorization", required: true, desc: "`Bearer {api_key}`" },
    { name: "X-Signature", required: true, desc: "HMAC-SHA256 signature" },
    { name: "X-Timestamp", required: true, desc: "ISO 8601 timestamp" },
    { name: "X-Secret-Salt", required: true, desc: "Secret salt for HMAC validation" },
  ]}
/>

### Path Parameters

<ParamTable
  rows={[
    { name: "id", type: "string", desc: "Report ID" },
  ]}
/>

## Response

### Success (200 OK)

```json
{
  "success": true,
  "data": {
    "id": "rep_550e8400-e29b-41d4-a716-446655440000",
    "merchantId": "mer_xxxxx",
    "type": "transactions",
    "format": "csv",
    "status": "completed",
    "startDate": "2024-01-01T00:00:00.000Z",
    "endDate": "2024-01-31T23:59:59.999Z",
    "filters": {
      "status": "succeeded"
    },
    "downloadUrl": "https://api.zenpayz.com/merchant/api/v1/reports/rep_550e8400/download",
    "fileSize": 125000,
    "rowCount": 1500,
    "createdAt": "2024-01-15T10:30:00.000Z",
    "completedAt": "2024-01-15T10:32:00.000Z"
  }
}
```

### Error Responses

<ErrorTable
  rows={[
    { code: "REPORT_NOT_FOUND", status: "404", message: "Report does not exist" },
  ]}
/>

<CodeRail>

## Examples

<Tabs groupId="language">
  <TabItem value="curl" label="cURL" default>

```bash
curl -X GET "https://api.zenpayz.com/merchant/api/v1/reports/rep_550e8400" \
  -H "Authorization: Bearer zp_test_xxxxx" \
  -H "X-Timestamp: 2024-01-15T10:30:00.000Z" \
  -H "X-Signature: a1b2c3d4e5f6..." \
  -H "X-Secret-Salt: your_secret_salt"
```

  </TabItem>
  <TabItem value="sdk" label="SDK">

```javascript
const report = await zenpays.reports.get('rep_550e8400');

if (report.status === 'completed') {
  console.log('Report ready:', report.downloadUrl);
}
```

  </TabItem>
</Tabs>

</CodeRail>

## Related Endpoints

- [Generate Report](/docs/rest-api/endpoints/reports/generate-report)
- [List Reports](/docs/rest-api/endpoints/reports/list-reports)
- [Download Report](/docs/rest-api/endpoints/reports/download-report)
