ManagementAPI credentialsA P I credentials merchant level

Create an API credential

POST
/merchants/{merchantId}/apiCredentials

Creates an API credential for the company account identified in the path. In the request, you can specify the roles and allowed origins for the new API credential.

The response includes the:

Make sure you store the API key securely in your system. You won't be able to retrieve it later.

If your API key is lost or compromised, you need to generate a new API key.

To make this request, your API credential must have the following roles:

  • Management API—API credentials read and write

Authorization

AuthorizationBasic <token>

In: header

Path Parameters

merchantId*string

The unique identifier of the merchant account.

Request Body

application/json

allowedOrigins?array<string>

The list of allowed origins for the new API credential.

description?string

Description of the API credential.

roles?array<string>

List of roles for the API credential. Only roles assigned to 'ws@Company.' can be assigned to other API credentials.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/merchants/string/apiCredentials" \  -H "Content-Type: application/json" \  -d '{    "roles": [      "Checkout webservice role"    ],    "allowedOrigins": [      "https://www.mystore.com"    ]  }'

Example response for adding an API credential.

{  "id": "YOUR_API_CREDENTIAL",  "username": "YOUR_USERNAME",  "clientKey": "YOUR_CLIENT_KEY",  "allowedIpAddresses": [],  "roles": [    "Checkout webservice role"  ],  "active": true,  "allowedOrigins": [    {      "id": "YOUR_ALLOWED_ORIGIN",      "domain": "https://www.mystore.com",      "_links": {        "self": {          "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/apiCredentials/YOUR_API_CREDENTIAL/allowedOrigins/YOUR_ALLOWED_ORIGIN"        }      }    }  ],  "_links": {    "self": {      "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/apiCredentials/YOUR_API_CREDENTIAL"    },    "allowedOrigins": {      "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/apiCredentials/YOUR_API_CREDENTIAL/allowedOrigins"    },    "generateApiKey": {      "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/apiCredentials/YOUR_API_CREDENTIAL/generateApiKey"    },    "generateClientKey": {      "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/apiCredentials/YOUR_API_CREDENTIAL/generateClientKey"    },    "merchant": {      "href": "https://management-test.adyen.com/v1/merchants/YOUR_MERCHANT_ACCOUNT"    }  },  "apiKey": "YOUR_API_KEY",  "password": "YOUR_PASSWORD"}