Accounts
An Account represents a permission boundary around Centrapay resources. Accounts can have API Keys and Account Memberships 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.
Account Model
Attributes
Subscription Model
Attributes
name
string
Create an Account
This endpoint allows you to create an Account.
Attributes
name
stringrequiredtype
stringrequiredowner
stringtest
booleanregion
string
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"}'{ "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": []}Get an Account
This endpoint allows you to retrieve an Account.
curl -X GET https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk \-H 'x-api-key: <TOKEN>'{ "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": []}Update an Account
This endpoint allows you to update an account.
Attributes
name
stringrequired
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"}'{ "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": []}Update Subscriptions
This endpoint allows you to update the subscriptions on an account.
Attributes
subscriptions
arrayrequired
Errors
INVALID_ACCOUNT_ID
403INVALID_SUBSCRIPTION
403
curl -X PUT https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk/subscriptions \-H 'content-type: application/json' \-H 'x-api-key: <TOKEN>' \-d '{ "subscriptions": [ "quartz" ]}'{ "subscriptions": [ "quartz" ]}