An Account represents a permission boundary around Centrapay resources. Accounts can have API Keys API and Account Memberships API which grant access to the resources.
Accounts are classified as either “individual” or “org”. Individual accounts can only have a single member and Centrapay users can only be a member of a single individual account.
Attributes
Attributes
name
string
POST/api/accounts
This endpoint allows you to create an Account.
Attributes
name
stringrequiredtype
stringrequiredowner
stringtest
booleanregion
string
Request
POST/api/accounts
curl -X POST \
https://service.centrapay.com/api/accounts \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"name": "Centrapay Cafe",
"type": "org"
}
'
Response
{
"id": "Jaim1Cu1Q55uooxSens6yk",
"name": "Centrapay Cafe",
"type": "org",
"region": "NZ",
"createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"createdAt": "2020-06-12T01:17:46.499Z",
"modifiedAt": "2020-06-12T01:17:46.499Z",
"modifiedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"version": "1",
"subscriptions": []
}
Request
GET/api/accounts/Jaim1Cu1Q55uooxSens6yk
curl -X GET \
https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk \
-H 'x-api-key: <TOKEN>'
Response
{
"id": "Jaim1Cu1Q55uooxSens6yk",
"name": "Centrapay Cafe",
"type": "org",
"region": "NZ",
"createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"createdAt": "2020-06-12T01:17:46.499Z",
"modifiedAt": "2020-06-12T01:17:46.499Z",
"modifiedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"version": "1",
"subscriptions": []
}
PUT/api/accounts/{accountId}
This endpoint allows you to update an account.
Attributes
name
stringrequired
Request
PUT/api/accounts/Jaim1Cu1Q55uooxSens6yk
curl -X PUT \
https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"name": "Shortland St Cafe"
}
'
Response
{
"id": "Jaim1Cu1Q55uooxSens6yk",
"name": "Shortland St Cafe",
"type": "org",
"region": "NZ",
"createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"createdAt": "2020-06-12T01:17:46.499Z",
"modifiedAt": "2020-06-12T02:35:12.112Z",
"modifiedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"version": "2",
"subscriptions": []
}
PUT/api/accounts/{accountId}/subscriptions
This endpoint allows you to update the subscriptions on an account.
Attributes
subscriptions
arrayrequired
Errors
INVALID_ACCOUNT_ID
403INVALID_SUBSCRIPTION
403
Request
PUT/api/accounts/Jaim1Cu1Q55uooxSens6yk/subscriptions
curl -X PUT \
https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk/subscriptions \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"subscriptions": [
"quartz"
]
}
'
Response
{
"subscriptions": [
"quartz"
]
}