First call
The quickest way to a real call, whatever you build: a partner account, a test organization with fictitious data, a private app installed there, a token taken with the app's own credentials and a GET /organization request. Every caller of the API is an app; the code that calls the API is the same for a private and a public app.
1. The partner account
Section titled "1. The partner account"-
Open Create account. You register once, with your email and a password, and confirm the address from the email you receive. Already have an account in the dashboard? Sign in with it: it is the same account.
-
Create the partner account: the name (merchants read it as "Developed by <name>"), optionally the website and the contact address (without one, emails go to your address), and accept the Partner agreement.
Team, roles and limits in detail: the partner account.
2. A test organization
Section titled "2. A test organization"-
In the portal, open Test organizations and create one: a name and the country.
-
The organization starts with no orders, with a test store, a test courier and test invoicing already connected, and with fictitious company details in the chosen country.
-
Press Open: the organization opens in the dashboard, like any merchant's. You are its owner.
3. A private app
Section titled "3. A private app"-
In the portal, open Apps, press New app and pick Private.
-
Name it, pick One of the account's organizations and choose the test organization. Create it.
-
Copy the
client_idand theclient_secret. The secret is shown once; it can be rotated later on Details. -
On Details, pick the
read_ordersscope and save.GET /organizationneeds no scope, butread_ordersserves the next steps. -
Press Publish in the bar above the tabs: a private app's version is published at once, with no review.
-
On Installations, copy the install link and open it. In the test organization, approve the app. It now shows in Applications → My applications.
4. A token
Section titled "4. A token"Ask for a token with the app's credentials (client credentials):
curl -X POST "https://connectato.com/oauth/token" \ -d grant_type=client_credentials \ -d client_id="$CLIENT_ID" \ -d client_secret="$CLIENT_SECRET"{ "token_type": "Bearer", "expires_in": 3600, "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."}The token lives 60 minutes; ask for a new one when it expires. Keep the secret on your server only (an environment variable, a secrets vault), never in public code, a browser or a mobile app.
5. Your first call
Section titled "5. Your first call"The token goes in the Authorization header as a Bearer token. The examples read it from the ACCESS_TOKEN environment variable.
curl "https://api.connectato.com/v1/organization" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Accept: application/json"<?php
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.connectato.com/v1/']);
$response = $client->get('organization', [ 'headers' => [ 'Authorization' => 'Bearer '.getenv('ACCESS_TOKEN'), 'Accept' => 'application/json', ],]);
$organization = json_decode((string) $response->getBody(), true);const response = await fetch('https://api.connectato.com/v1/organization', { headers: { Authorization: `Bearer ${process.env.ACCESS_TOKEN}`, Accept: 'application/json', },});
const organization = await response.json();import os
import requests
response = requests.get( "https://api.connectato.com/v1/organization", headers={ "Authorization": f"Bearer {os.environ['ACCESS_TOKEN']}", "Accept": "application/json", },)
organization = response.json()6. Read the response
Section titled "6. Read the response"A 200 response shows the organization and what the caller may do:
{ "id": "org_01jcq2b8h4n6r0t5v9x3z7k1mp", "name": "Test ERP", "timezone": "Europe/Bucharest", "caller": { "scopes": ["read_orders"], "app_id": "9d3f6a52-7c1e-4b8a-a0f2-5e6c7d8b9a10", "store": null }}idis the organization's public id, the same one webhooks carry.caller.scopesare the scopes the requests may use.caller.app_idis the app'sclient_id.caller.storeis the store a store app is in the organization (store apps),nullfor any other app.
A wrong or expired token, or an app not installed yet, gets a 401, with an application/problem+json error (errors). Responses carry the X-RateLimit-Limit and X-RateLimit-Remaining headers (rate limits): an authenticated response for the installation's limit, a 401 for the IP address's limit. Every response carries X-Request-Id.
- In the test organization, open the test store and press Create a test order, then call
GET https://api.connectato.com/v1/orders(pagination). - Private apps: new versions, more scopes, webhooks, a client's organization.
- Building for many merchants: your app as a public app, installed through OAuth.
- Try the API right from the docs, with your token.