Learn about the Square API Logs feature, which lets you view the request and response of API calls.
Square APIs write transaction information to a central log that you can use for diagnostics, troubleshooting, and auditing. The logs consist of an overview page showing all entries and a detailed page for each log entry that shows the transaction request and response, as well as a summary of the API call. Sensitive data, such as access codes and merchant IDs, are redacted from the logs. Logs are retained for 28 days.
After each request in API Explorer, a View Logs button appears in the response pane. Choose the button to view the log files.
Note
The maximum size of an individual log entry is 50k. Any bytes beyond that limit are truncated.
The API Logs page gives you the ability to search and filter log entries. The following screenshot shows the features of API Logs:
- Filter log entries by date and time.
- Filter log entries by API, endpoint, HTTP status code, or error code.
- Search log entries by keyword, API name, or other values.
- The overview table includes:
- The status code returned by the API request.
- The Square API called.
- The endpoint and HTTP method.
- The date of the request.
Each log entry has a summary, request, and response page.
The Summary tab shows application and seller information along with the API name and endpoint.
The Request tab shows the API request and provides links to the API Reference and to API Explorer. Use the Copy button to copy the request.
The Response tab shows the API response and provides links to the API Reference and to API Explorer. Use the Copy button to copy the response.