Skip to main content

Authentication

Authentication for requests is provided in the Authorization header as a token, with or without a Bearer prefix.

In order to properly authorize ourselves, we need three things;

  1. API User
  2. API Key
  3. Appropriate role

API User

API users can be created using CreateApiUser:

{
"User": {
"Name": "AdyenApiUser",
"NickName": "Adyen",
}
}

This service returns the UserID for your newly created user. Result can be one of two things:

  • 0 = CreatedApiUser
  • 1 = NicknameInUse
note

If you set up requirements such as EmailAdress or LastName for user creation, these will not apply to API Users.

API keys

To fetch our token, we need to add a key for our newly created API User using CreateApiKey:

{
"UserID": 45,
"OrganizationUnitID": 23,
"RequestPermanentApiKey": true
}

Needless to say; a token is only valid for the single environment it was created or requested on.

To list all API keys for a specific user, use ListUserApiKeys:

{
"UserID": 45
}

This returns a list of API keys. It does not return their values, but their ID's. You can see we have two API keys for this user. That's because we created an additional one, so we can delete the key that we have so blatantly pasted into our docs. To delete an API key, call DeleteApiKey using the desired key's ID.

{
"KeyID": 43
}

When successful, this service returns an empty response.

Setting the appropriate role

As with any user, we should set up a proper role for the operations the API user will perform.