API Keys
API keys provide enduring access to a single Centrapay Account .
API Key Model
Attributes
Create an API Key
This endpoint allows you to create an API key.
Attributes
-
name
string required -
role
string required
curl -X POST \ https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk/api-keys \ -H 'content-type: application/json' \ -H 'x-api-key: <TOKEN>' \ -d '{ "name": "MyAPIkey", "role": "merchant-terminal"}'
{ "name": "MyAPIkey", "createdAt": "2020-06-01T22:32:56.631Z", "createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:AdminKey", "modifiedAt": "2020-06-01T22:32:56.631Z", "modifiedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:AdminKey", "enabled": true, "role": "merchant-terminal", "accountId": "Jaim1Cu1Q55uooxSens6yk", "version": "1", "secret": "EoaEL7skkedBBy9MzrBSyxG95vUAKjYkiFvWEfiAx"}
List API Keys
This endpoint allows you to list all API Keys for an Account.
curl -X GET \ https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk/api-keys \ -H 'x-api-key: <TOKEN>'
[ { "accountId": "Jaim1Cu1Q55uooxSens6yk", "name": "MyOtherAPIkey", "createdAt": "2020-06-01T21:57:25.888Z", "createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:AdminKey", "modifiedAt": "2020-06-01T21:57:25.888Z", "modifiedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:AdminKey", "enabled": false, "version": "1", "role": "merchant-terminal" }, { "accountId": "Jaim1Cu1Q55uooxSens6yk", "name": "MyAPIkey", "createdAt": "2020-06-01T22:34:31.308Z", "createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:AdminKey", "modifiedAt": "2020-06-01T22:34:31.308Z", "modifiedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:AdminKey", "enabled": true, "version": "1", "role": "merchant-terminal" }]
Update an API Key
This endpoint allows you to enable or disable an API key.
Attributes
-
enabled
boolean required
curl -X PUT \ https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk/api-keys/MyAPIkey \ -H 'content-type: application/json' \ -H 'x-api-key: <TOKEN>' \ -d '{ "enabled": false}'
{ "accountId": "Jaim1Cu1Q55uooxSens6yk", "name": "MyAPIkey", "createdAt": "2020-06-01T22:34:31.308Z", "createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:AdminKey", "modifiedAt": "2020-07-02T22:34:31.308Z", "modifiedBy": "crn:Jaim1Cu1Q55uooxSens6yk:api-key:MyAPIkey", "enabled": false, "version": "2", "role": "merchant-terminal"}