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
/api/accounts
This endpoint allows you to create an Account.
Attributes
-
name
-
type
-
owner
-
test
-
region
Request
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
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": []
}
/api/accounts/{accountId}
This endpoint allows you to update an account.
Attributes
-
name
Request
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": []
}
/api/accounts/{accountId}/subscriptions
This endpoint allows you to update the subscriptions on an account.
Attributes
-
subscriptions
Errors
-
INVALID_ACCOUNT_ID
-
INVALID_SUBSCRIPTION
Request
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"
]
}