An event is a record of a user action or outcome. Centrapay performs various tasks in response to events.
/api/accounts/{accountId}/events
This endpoint allows you to create an Event API .
Attributes
type
idempotencyKey
data
Errors
EVENT_ALREADY_EXISTS
Request
curl -X POST \
https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk/events \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"type": "user-login",
"idempotencyKey": "login-de32dd90-b46c-11ea-93c3-83a333b86e7b",
"data": {
"userId": "b657195e-dc2f-11ea-8566-e7710d592c99-123"
}
}
'
Response
{
"id": "L75M3L56N2PtBSt8g7uXLU",
"accountId": "Jaim1Cu1Q55uooxSens6yk",
"type": "user-login",
"data": {
"userId": "b657195e-dc2f-11ea-8566-e7710d592c99-123"
},
"idempotencyKey": "login-de32dd90-b46c-11ea-93c3-83a333b86e7b",
"createdAt": "2020-05-01T12:30:00.000Z",
"createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey"
}