# API Debugging

## Overview
The **Partners Platform** provides robust debugging tools to help developers monitor, analyze, and troubleshoot API interactions. The **Request Log** and **Webhook Log** offer comprehensive insights into all incoming API requests, their responses, and outgoing webhooks, ensuring smooth integration and issue resolution.

## Request Log
The **Request Log** captures all incoming API requests, including their headers, payloads, and responses. This allows developers to:

- View detailed request and response data.
- Debug API calls and identify potential issues.
- Monitor API performance and behavior over time.

### Accessing the Request Log
1. Log in to the [**Partners Platform**](https://partners.service.cedar.money/).
2. Navigate to **API** > [**API Request Logs**](https://partners.service.cedar.money/app/crud/BrandApiRequestLog/table).
3. Review the list of all API requests, including their timestamps, request details, and response codes.

## Webhook Log
The **Webhook Log** provides visibility into all outgoing webhook events triggered by the system. This log enables developers to:

- Track webhook delivery status and response times.
- Replay failed webhooks to ensure successful event processing.
- Test webhook endpoints using mock data for debugging.

### Webhook Replay and Testing
To enhance debugging and troubleshooting, the **Partners Platform** offers the ability to:

- **Replay Webhooks**: Resend a previously sent webhook event to its destination.
- **Test Webhooks with Mock Data**: Send test events with custom mock data to verify endpoint handling.

### Accessing the Webhook Log
1. Log in to the [**Partners Platform**](https://partners.service.cedar.money/).
2. Navigate to **API** > [**API Webhook Logs**](https://partners.service.cedar.money/app/crud/BrandApiWebhookLog/table).
3. View details of all webhook events, including payloads, status, and response codes.
4. Select an event to replay or test with mock data.

## Best Practices
- Regularly monitor the **Request Log** and **Webhook Log** to identify and resolve issues early.
- Use the **replay** function to troubleshoot failed webhooks without modifying live transactions.
- Utilize mock data testing to ensure webhook endpoints are correctly implemented before going live.

