A Business represents a company registered with the New Zealand Companies Office. It is associated with a single Account API .
Attributes
Onboarding Statuses
Status | Description | Allowed Reasons |
---|---|---|
applied | Identifies businesses that have registered to be activated for the Centrapay service. | |
provisioning | Identifies businesses that are in the process of being activated for the Centrapay service. | |
active | Identifies businesses that have been activated for Centrapay services successfully (i.e. they have successfully created a Payment Request). | |
deactivated | Identifies businesses that have been de-registered for the Centrapay service. | data-quality-issues,change-of-ownership, centrapay-discontinued, duplicate, blocked |
on-hold | Identifies businesses that have been placed on hold. | seasonal-business-closure, no-response |
Onboarding Status Reasons
Reason | Description |
---|---|
duplicate | The business already exists in the Centrapay system. |
data-quality-issues | Data quality issues are preventing the business from onboarding. |
no-response | No response has been received from the business. |
change-of-ownership | The business has changed ownership. |
centrapay-discontinued | The business is no longer using Centrapay. |
seasonal-business-closure | The business has closed temporarily. |
Attributes
-
value
-
type
/api/businesses
This endpoint allows you to create a new Business. If accountId
is not provided when creating a Business, then a new org account will be created and associated to the Business.
Attributes
-
nzbn
-
accountId
-
test
-
taxNumber
Errors
-
INVALID_ACCOUNT
-
INVALID_NZBN
-
BUSINESS_ALREADY_EXISTS
Request
curl -X POST \
https://service.centrapay.com/api/businesses \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"nzbn": "9429046246448",
"taxNumber": {
"value": "123-456-789",
"type": "nz-gst"
}
}
'
Response
{
"id": "DKTs3U38hdhfEqwF1JKoT2",
"accountId": "Jaim1Cu1Q55uooxSens6yk",
"accountName": "Centrapay",
"nzbn": "9429046246448",
"name": "CENTRAPAY LIMITED",
"tradingName": "CentraPay",
"companyNumber": "6340244",
"createdAt": "2020-06-12T01:17:46.499Z",
"updatedAt": "2020-06-12T01:17:46.499Z",
"createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"updatedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"taxNumber": {
"value": "123-456-789",
"type": "nz-gst"
},
"onboardingStatus": "applied"
}
/api/businesses/{businessId}
This endpoint allows you to update a Business.
Attributes
-
tradingName
-
taxNumber
-
farmlandsBusinessNumber
Request
curl -X PUT \
https://service.centrapay.com/api/businesses/DKTs3U38hdhfEqwF1JKoT2 \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"taxNumber": {
"value": "123-456-789",
"type": "nz-gst"
},
"farmlandsBusinessNumber": "12345678"
}
'
Response
{
"id": "DKTs3U38hdhfEqwF1JKoT2",
"accountId": "Jaim1Cu1Q55uooxSens6yk",
"accountName": "Centrapay",
"nzbn": "9429046246448",
"name": "CENTRAPAY LIMITED",
"tradingName": "CentraPay",
"companyNumber": "6340244",
"createdAt": "2020-06-12T01:17:46.499Z",
"updatedAt": "2020-06-12T01:17:46.499Z",
"createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"updatedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"taxNumber": {
"value": "123-456-789",
"type": "nz-gst"
},
"farmlandsBusinessNumber": "12345678",
"onboardingStatus": "applied"
}
/api/accounts/{accountId}/business
This endpoint allows you to retrieve a Business by account id.
Request
curl -X GET \
https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk/business \
-H 'x-api-key: <TOKEN>'
Response
{
"id": "DKTs3U38hdhfEqwF1JKoT2",
"accountId": "Jaim1Cu1Q55uooxSens6yk",
"accountName": "Centrapay",
"nzbn": "9429046246448",
"name": "CENTRAPAY LIMITED",
"tradingName": "CentraPay",
"companyNumber": "6340244",
"createdAt": "2020-06-12T01:17:46.499Z",
"updatedAt": "2020-06-12T01:17:46.499Z",
"createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"updatedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey"
}
/api/nzbn-search
This endpoint returns a list of companies that match the queried param on company name, nzbn number or company number. Results are paginated API and ordered by relevance.
Request
curl -X GET \
'https://service.centrapay.com/api/nzbn-search?q=centrapay' \
-H 'x-api-key: <TOKEN>'
Response
{
"items": [
{
"nzbn": "9429046246448",
"companyName": "CENTRAPAY LIMITED",
"companyNumber": "6340244"
}
]
}
/api/nzbn/{nzbn}
This endpoint allows you to retrieve a Business by account id.
Request
curl -X GET \
https://service.centrapay.com/api/nzbn/9429046246448 \
-H 'x-api-key: <TOKEN>'
Response
{
"nzbn": "9429046246448",
"companyName": "CENTRAPAY LIMITED",
"tradingName": "CentraPay",
"companyNumber": "6340244",
"directors": [
{
"firstName": "John",
"lastName": "DOE",
"addressLines": [
"7 Tara Street",
"Downmore",
"Auckland"
]
},
{
"firstName": "Jane",
"lastName": "DOE",
"addressLines": [
"82 Greatwood Road",
"Northclover",
"Auckland"
]
}
]
}
/api/businesses/{businessId}/set-onboarding-status
This endpoint returns allows you to set the onboarding status of a Business.
Attributes
-
onboardingStatus
crn -
onboardingStatusReason
Errors
-
BUSINESS_ALREADY_EXISTS
Request
curl -X POST \
https://service.centrapay.com/api/businesses/DKTs3U38hdhfEqwF1JKoT2/set-onboarding-status \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"onboardingStatus": "deactivated",
"onboardingStatusReason": "change-of-ownership"
}
'
Response
{
"type": "set-onboarding-status",
"onboardingStatus": "deactivated",
"onboardingStatusReason": "change-of-ownership",
"businessId": "DKTs3U38hdhfEqwF1JKoT2",
"createdAt": "2020-06-12T01:17:46.499Z",
"createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
"activityNumber": 2
}