https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f8137b2b-4759-4835-94ba-f3b216ca87cd/Color_WhiteBG.png


For version: 23.*.*

Last updated: March 9, 2024


The following examples demonstrate usage of the most common functionality of Scanye API. All the examples assume the API is hosted at API-URL and accepts authorization with API-KEY.

<aside> 💡 Note: When using Scanye’s public production API, replace API-URL with api.scanye.pl or api.scanye.io and when testing, use api-test-new.scanye.pl or api-test-new.scanye.io.

</aside>


Authentication and authorization

Creating an account

curl -X POST                          \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/json"       \\
  -d '{
    "email": "[email protected]",
    "password": "qweASD12#",
    "acceptTerms": true,
    "userType": "Accountant",
    "companyDetails": {
      "taxNo": "PL5272767250",
      "countryCode": "PL",
			"name": "Scanye Sp. z o.o.",
			"phone": "+48509333337",
			"address": {
				"city": "Warszawa",
				"address": "Grzybowska 87",
				"postalCode": "00-844"
			}
    }
  }' \\
  <https://API-URL/auth/register>

In case of success, a empty 200 OK response should be generated containing a temporary (by default valid 30 days) API key generated for the user:

{"apiKey": "e02287cc851126afed67e2e4721e0c0250dc"}

This key may now be used as an authentication and authorization token when talking to the API.

Moreover an e-mail with a verification token would be sent to the e-mail address used for registration (unless e-mail address verification is disabled in API server configuration; it is on api-test-new by default). An account, although immediately active after registration, must be verified (see Verifying an account) within 24 hours or else it would be automatically suspended.

There are currently three user types: Accountant, Entrepreneur and InternalAccountant.

Verifying an account

After an e-mail with the token arrives, use the token to verify (activate) your account:

curl -X POST                          \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/json"       \\
  -d '{"token": "deadbeef123"}'       \\
  <https://API-URL/auth/activate>