Search docs

Are you looking for test card numbers?

Would you like to contact support?

Start searching Adyen's documentation...

  Documentation

How to get an Origin Key

Learn how to generate an Origin Key for our JavaScript libraries.


An Origin Key is a unique key that is tied to the domain of your website. If you're using our API integration, an Origin Key is needed to verify the origin of web-initiated payments that use our Secured Fields or Components JavaScript libraries.

You'll need an Origin Key for each domain that you accept payments from. If you have multiple domains, you will need to generate multiple Origin Keys.

Generate Origin Key

To generate an Origin Key : 

  1. In your Customer Area, go to Account > Users.

  2. Click on the ws@Company.[YourCompanyAccount] user.

  3. Under Origin key, enter your website's domain and 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.com/ or https://checkout.your-company.com:8080/.

  4. Copy your Origin Key and securely store in your system.

Generate multiple Origin Keys

An Origin Key is required for each domain where you are using our JavaScript libraries and from where you are initiating payments. You can generate an Origin Key for each domain in your Customer Area. If you have many domains and generating them by hand is unreasonable, you can also use our /originKeys API call:

We'll return an originKey for each of the originDomains you specified in the request.

curl https://checkout-test.adyen.com/v40/originKeys \
-H "X-API-key: [Your API Key here]" \
-H "Content-Type: application/json" \
-d '{
   "originDomains":[
      "https://www.your-company1.com",
      "https://www.your-company2.com",
      "https://www.your-company3.com"
   ]
}'
# 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"
   ]
})
// 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<String>(Arrays.asList(
    "https://www.your-company1.com",
    "https://www.your-company2.com",
    "https://www.your-company3.com")
));
OriginKeysResponse originKeysResponse = checkoutUtility.originKeys(originKeysRequest);
// 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);

/originKeys response

{
   "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..."
   }
}

See also