Skip to content

Create customer

Request

This API endpoint allows you to create new customer. On success you'll receive JSON with key for the newly created customer. Please note that it will take some time to initialize the customer in our systems. Customer's status will be shown as creating while setup is in progress. Once status changes to ok the customer is fully operational.

Key can also be left out, in which case we'll create key based on company name.

If you are using ZAPI to connect customers into Zoined, you should leave out the dataSource block in the request. In addition to key, you'll also receive customers ZAPI token in the response in field token.

If you are using database fetch, you'll need to provide connection credentials in the dataSource block. On setups where multiple companies are stored in the same database, you can also optionally specify filters block for limiting the amount of data that gets imported.

{
  "dataSource": {
    "filters": {
      "companyId": "123"
    }
  }
}

POST https://partners.zoined.com/api/customers

Security
partnerToken
Bodyapplication/jsonrequired
curl -i -X POST \
  https://zone-api.zoined.com/_mock/api/customers \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Demo company",
    "key": "dm_company",
    "environment": "production",
    "locale": "en",
    "country": "FI",
    "currency": "EUR",
    "dateOffset": 0,
    "dataSource": {
      "host": "db-host",
      "port": 3306,
      "database": "database_name",
      "username": "db-username",
      "password": "db-password"
    },
    "adminUser": {
      "firstName": "My",
      "lastName": "Name",
      "email": "my.name@nonexisting.addr"
    },
    "licenses": [
      "limited"
    ]
  }'

Responses

Customer creation has been accepted.

Bodyapplication/json
keystring
Example:"dm_company"
tokenstring

Returned for customers connected through ZAPI.

Example:"abcdefghijklmn"
Response
{ "key": "dm_company" }