--- title: "How to get an origin key" url: "https://docs.adyen.com/development-resources/how-to-get-an-origin-key" source_url: "https://docs.adyen.com/development-resources/how-to-get-an-origin-key.md" canonical: "https://docs.adyen.com/development-resources/how-to-get-an-origin-key" last_modified: "2020-08-13T10:00:00+02:00" language: "en" --- # How to get an origin key An origin key is a client-side key that is used to validate Adyen's JavaScript component library. It is required for our [Drop-in](/online-payments/drop-in-web) and [Component](/online-payments/components-web/) integrations. The origin key is deprecated, and removed starting [Web Components 4.0.0](/online-payments/release-notes#releaseNote=2021-02-25-web-componentsdrop-in-4.0.0).\ [Switch to using the client key](/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key) for your Web Drop-in or Web Component integration. The origin key is linked directly to a combination of three elements: * The account name (either your company or merchant account). * The environment (*live* or *test*). * The website domain where a payment request comes from (including the port). If one or more of these elements change — such as a change to the protocol, port, or environment — you will need a different origin key. For example, if you are initially performing test transactions on your local machine, a domain of **https\://localhost:8080**, and you move your tests to a test server on your local network, a domain of **https\://192.168.10.10**, you will need need to create a new origin key for this new server. If you have multiple domains, you can use our `/originKeys` API call to quickly [generate multiple origin keys](#generate-multiple-origin-keys). ## Generate a single origin key The origin key is deprecated, and removed starting [Web Components 4.0.0](/online-payments/release-notes#releaseNote=2021-02-25-web-componentsdrop-in-4.0.0).\ [Switch to using the client key](/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key) for your Web Drop-in or Web Component integration. 1. Log in to your [Customer Area](https://ca-test.adyen.com/). 2. Navigate to **Developers** > **API credentials**, and click the user **ws\@Company.\[YourCompanyAccount]**. 3. Under **Origin key**, enter your website's domain, then click **Generate Origin Key**. Use a concatenation of the protocol, host, and port. Do not include subdirectories or a trailing slash. For example, **https\://your-company.example.com** or **https\://checkout.your-company.example.com:8080**. You can also confirm this by opening the browser console and calling `window.location.origin`. 4. Copy and safely store the origin key in your system. ## Generate multiple origin keys The origin key is deprecated, and removed starting [Web Components 4.0.0](/online-payments/release-notes#releaseNote=2021-02-25-web-componentsdrop-in-4.0.0).\ [Switch to using the client key](/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key) for your Web Drop-in or Web Component integration. If you have many domains, you can use our `/originKeys` API call to quickly generate multiple origin keys: 1. Make an `/originKeys` request, specifying: * [Your API key](/development-resources/api-credentials#generate-api-key). * `originDomains`: Include each domain that you will use to make payments. #### curl ```bash curl https://checkout-test.adyen.com/v1/originKeys \ -H 'x-api-key: ADYEN_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "originDomains":[ "https://www.your-company1.com", "https://www.your-company2.com", "https://www.your-company3.com" ] }' ``` #### Java ```java // Set your X-API-KEY with the API key from the Customer Area. Config config = new Config(); config.setApiKey("Your X-API-KEY")); Client client = new Client(config);   CheckoutUtility checkoutUtility = new CheckoutUtility(client); OriginKeysRequest originKeysRequest = new OriginKeysRequest(); originKeysRequest.setOriginDomains(new ArrayList(Arrays.asList( "https://www.your-company1.com", "https://www.your-company2.com", "https://www.your-company3.com") )); OriginKeysResponse originKeysResponse = checkoutUtility.originKeys(originKeysRequest); ``` #### PHP ```php // Set your X-API-KEY with the API key from the Customer Area. $client = new \Adyen\Client(); $client->setXApiKey("YOUR X-API-KEY"); $service = new \Adyen\Service\CheckoutUtility($client); $params = array( "originDomains" => array( "https://www.your-domain1.com", "https://www.your-domain2.com", "https://www.your-domain3.com" ) ); $result = $service->originKeys($params); ``` #### Ruby ```ruby # Set your X-API-KEY with the API key from the Customer Area. adyen = Adyen::Client.new adyen.api_key = "YOUR X-API-KEY" response = adyen.checkout_utility.origin_keys({ :originDomains => [ "https://www.your-company1.com", "https://www.your-company2.com", "https://www.your-company3.com" ] }) ``` The `/originKeys` response contains a list of origin key for all requested domains. For each list item, the key is the domain, and the value is its associated origin key. **/originKeys response** ```json { "originKeys":{ "https://www.your-company1.com":"pub.v2.99...", "https://www.your-company2.com":"pub.v2.99...", "https://www.your-company3.com":"pub.v2.99..." } } ``` 2. Copy and safely store the origin keys in your system. ## See also * [How to get the API key](/development-resources/api-credentials) * [Drop-in](/online-payments/drop-in-web) * [Components](/online-payments/components-web)