{"title":"API authentication types","category":"default","creationDate":1779533780,"content":"<p>Each API request that you make to Adyen must be authenticated. You can use either of the following authentication types:<\/p>\n<ul>\n<li><a href=\"#api-key-authentication\">API key authentication<\/a><\/li>\n<li><a href=\"#using-basic-authentication\">Basic authentication<\/a><\/li>\n<\/ul>\n<p>If you are using Adyen's <a href=\"\/development-resources\/libraries\">API libraries<\/a>, you only need to generate and provide the credentials for the authentication type that you'll use. The libraries handle authenticating with Adyen. However, if you are making direct calls to Adyen APIs, then you must handle the authentication as described below.<\/p>\n<h2 id=\"api-key-authentication\">API key authentication<\/h2>\n<p>Authenticate your request by sending an API key in an <code>x-API-key<\/code> HTTP request header.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'API key in the request header'\" :id=\"''\" :code-data='[{\"language\":\"http\",\"tabTitle\":\"\",\"content\":\"POST \\\/v68\\\/paymentMethods HTTP\\\/1.1\\nHost: checkout-test.adyen.com\\nContent-Type: application\\\/json\\nx-API-key: ADYEN_API_KEY\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>You can <a href=\"\/development-resources\/api-credentials#generate-api-key\">generate an API key<\/a> from your Customer Area.<\/p>\n<h2 id=\"using-basic-authentication\">Basic authentication<\/h2>\n<p>Authenticate your request by sending a username and password in an <code>Authorization<\/code> HTTP request header.<\/p>\n<pre><code class=\"language-http\">Authorization: Basic YOUR_CREDENTIALS<\/code><\/pre>\n<p>In the header,<code>YOUR_CREDENTIALS<\/code> is the base64 encoded combination of the basic authentication username and password separated by a colon. For example, <code>ws_12345@Company.YourCompany:YOUR_BASIC_AUTH_PASSWORD<\/code>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Basic authentication in the request header'\" :id=\"''\" :code-data='[{\"language\":\"http\",\"tabTitle\":\"\",\"content\":\"POST \\\/v68\\\/paymentMethods HTTP\\\/1.1\\nHost: checkout-test.adyen.com\\nContent-Type: application\\\/json\\nAuthorization: Basic d3NfMTIzNDVAQ29tcGFueS5Zb3VyQ29tcGFueTpZT1VSX0JBU0lDX0FVVEhfUEFTU1dPUkQK\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>You can <a href=\"\/development-resources\/api-credentials#basic-authentication\">generate a basic authentication username and password<\/a> from your Customer Area.<\/p>\n<p><\/p>","url":"https:\/\/docs.adyen.com\/development-resources\/api-authentication","articleFields":{"description":"Learn how you can authenticate API requests that you make to Adyen.","feedback_component":true,"next_steps":[{"title":"Generate your API credentials","description":"Get your API credentials from your Customer Area.","url":"\/development-resources\/api-credentials","required":false}],"id":"34120911","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"22-11-2021 14:41"},"algolia":{"url":"https:\/\/docs.adyen.com\/development-resources\/api-authentication","title":"API authentication types","content":"Each API request that you make to Adyen must be authenticated. You can use either of the following authentication types:\n\nAPI key authentication\nBasic authentication\n\nIf you are using Adyen's API libraries, you only need to generate and provide the credentials for the authentication type that you'll use. The libraries handle authenticating with Adyen. However, if you are making direct calls to Adyen APIs, then you must handle the authentication as described below.\nAPI key authentication\nAuthenticate your request by sending an API key in an x-API-key HTTP request header.\n\n    \n\nYou can generate an API key from your Customer Area.\nBasic authentication\nAuthenticate your request by sending a username and password in an Authorization HTTP request header.\nAuthorization: Basic YOUR_CREDENTIALS\nIn the header,YOUR_CREDENTIALS is the base64 encoded combination of the basic authentication username and password separated by a colon. For example, ws_12345@Company.YourCompany:YOUR_BASIC_AUTH_PASSWORD.\n\n    \n\nYou can generate a basic authentication username and password from your Customer Area.\n","type":"page","locale":"en","boost":18,"hierarchy":{"lvl0":"Home","lvl1":"Development resources","lvl2":"API authentication types"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/development-resources","lvl2":"\/development-resources\/api-authentication"},"levels":3,"category":"Development Resources","category_color":"green","tags":["authentication","types"]}}
