{"title":"API logs","category":"default","creationDate":1640086560,"content":"<p>When you are integrating with Adyen, you may want to analyze or debug API requests, for example for test payments.<\/p>\n<p>Using API logs, you can see information about your API requests in the Customer Area. You can troubleshoot the requests and responses, and see the metadata of your API requests.<\/p>\n<p>The logs show all API requests made in your test or live environment in the past thirty days. Requests older than thirty days are removed from the API logs.<\/p>\n<h2>Using API logs<\/h2>\n<div class=\"notices green\">\n<p>API logs only support API requests that use JSON.<\/p>\n<\/div>\n<p>To view API logs, you must have one of these <a href=\"\/account\/user-roles\">user roles<\/a>:<\/p>\n<ul>\n<li>Merchant admin<\/li>\n<li>Technical integrator<\/li>\n<\/ul>\n<p>To view and search API logs:<\/p>\n<ol>\n<li>Log in to your <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>. Stay on the company account or select a merchant account. API logs for APIs used in a balance platform integration are available on the company account.<\/li>\n<li>Select <strong>Developers &gt; API logs<\/strong>. This will show a list of every API request made in the past thirty days.<\/li>\n<li>Select an item to see the details of that API request. You will see the timestamp, which API was called, the PSP reference or resource ID, and full details of the request and response. Type a PSP reference or request ID into the search bar, or use the various filter options to search by date, API, endpoint, or HTTP method.<\/li>\n<\/ol>\n<h2>Example<\/h2>\n<p>You can use API logs in end-to-end testing, to see details of the requests you have made to our APIs.<\/p>\n<p>If you are testing the checkout flow for your online payments setup and a payment fails, you can check the API logs to see details of what you sent to the API and why the payment failed. You can compare failed API requests with successful ones.<\/p>\n<p>Go to the API logs page. In the <strong>PSP reference<\/strong> column, select the payment reference to see details of the API request.<\/p>\n<ul>\n<li>\n<p>Under <strong>Response status<\/strong> at the top right of the page you will see the <a href=\"\/development-resources\/error-codes\">error code<\/a>.<\/p>\n<\/li>\n<li>\n<p>In the <strong>Request body<\/strong> section, you see the details of the request, including which endpoint the request was sent to.<\/p>\n<\/li>\n<li>\n<p>In the <strong>Response body<\/strong> section, you can see details of the response.<\/p>\n<\/li>\n<\/ul>\n<p>For example, when you see error code 422, the API request contained input that was not valid. The response body shows which field had the invalid input.<\/p>\n<p>You can then check on your side what input was sent and make changes.<\/p>\n<h2 id=\"see-also\">See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/development-resources\/testing\/result-codes\"\n                        target=\"_self\"\n                        >\n                    Test authorisation result codes\n                <\/a><\/li><li><a href=\"\/development-resources\/error-codes\"\n                        target=\"_self\"\n                        >\n                    Error codes and messages\n                <\/a><\/li><li><a href=\"\/development-resources\/response-handling\"\n                        target=\"_self\"\n                        >\n                    Response handling\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/development-resources\/logs-resources\/api-logs","articleFields":{"description":"Learn how to use API logs to analyze or debug API requests.","feedback_component":true,"last_edit_on":"13-04-2023 13:37","filters_component":false,"page_id":"50f571b0-a5ec-4677-9ab5-dd042eda5b6a","decision_tree":"[]"},"algolia":{"url":"https:\/\/docs.adyen.com\/development-resources\/logs-resources\/api-logs","title":"API logs","content":"When you are integrating with Adyen, you may want to analyze or debug API requests, for example for test payments.\nUsing API logs, you can see information about your API requests in the Customer Area. You can troubleshoot the requests and responses, and see the metadata of your API requests.\nThe logs show all API requests made in your test or live environment in the past thirty days. Requests older than thirty days are removed from the API logs.\nUsing API logs\n\nAPI logs only support API requests that use JSON.\n\nTo view API logs, you must have one of these user roles:\n\nMerchant admin\nTechnical integrator\n\nTo view and search API logs:\n\nLog in to your Customer Area. Stay on the company account or select a merchant account. API logs for APIs used in a balance platform integration are available on the company account.\nSelect Developers &gt; API logs. This will show a list of every API request made in the past thirty days.\nSelect an item to see the details of that API request. You will see the timestamp, which API was called, the PSP reference or resource ID, and full details of the request and response. Type a PSP reference or request ID into the search bar, or use the various filter options to search by date, API, endpoint, or HTTP method.\n\nExample\nYou can use API logs in end-to-end testing, to see details of the requests you have made to our APIs.\nIf you are testing the checkout flow for your online payments setup and a payment fails, you can check the API logs to see details of what you sent to the API and why the payment failed. You can compare failed API requests with successful ones.\nGo to the API logs page. In the PSP reference column, select the payment reference to see details of the API request.\n\n\nUnder Response status at the top right of the page you will see the error code.\n\n\nIn the Request body section, you see the details of the request, including which endpoint the request was sent to.\n\n\nIn the Response body section, you can see details of the response.\n\n\nFor example, when you see error code 422, the API request contained input that was not valid. The response body shows which field had the invalid input.\nYou can then check on your side what input was sent and make changes.\nSee also\n\n\n                    Test authorisation result codes\n                \n                    Error codes and messages\n                \n                    Response handling\n                \n","type":"page","locale":"en","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Development resources","lvl2":"Logs","lvl3":"API logs"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/development-resources","lvl2":"https:\/\/docs.adyen.com\/development-resources\/logs-resources","lvl3":"\/development-resources\/logs-resources\/api-logs"},"levels":4,"category":"Development Resources","category_color":"green","tags":[]}}
