API keys provide enduring access to a single Centrapay Account API .
Attributes
/api/accounts/{accountId}/api-keys
This endpoint allows you to create an API key.
Attributes
-
name
-
role
Request
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"
}
'
Response
{
"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"
}
/api/accounts/{accountId}/api-keys
This endpoint allows you to list all API Keys for an Account.
Request
curl -X GET \
https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk/api-keys \
-H 'x-api-key: <TOKEN>'
Response
[
{
"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"
}
]
/api/accounts/{accountId}/api-keys/{apiKeyName}
This endpoint allows you to enable or disable an API key.
Attributes
-
enabled
Request
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
}
'
Response
{
"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"
}