Quickstart

Set up a development app and make your first Digits Connect API request.

This guide uses the Developer Sandbox and OAuth 2.0 authorization code flow to make a read-only request. You only need a browser, OpenSSL, and cURL.

1. Create a Developer Sandbox

Create a free developer account, then select Access Developer Sandbox in the Developer Dashboard. Digits will provision a demo company with sample data.

2. Create an App

In the Developer Dashboard, select Create App, choose the ledger:read scope, and save the app.

3. Configure the Redirect URI

  1. Open the app's Configuration page.
  2. Add http://localhost:3000/callback as a redirect URI.
  3. Click Save.
  4. Confirm that the redirect URI remains listed before continuing.

4. Get Development Keys

Open Keys, select Development, and copy the Client ID and Client Secret. Set them in your terminal:

export DIGITS_CLIENT_ID="<development_client_id>"
export DIGITS_CLIENT_SECRET="<development_client_secret>"
export DIGITS_REDIRECT_URI="http://localhost:3000/callback"
🔒

Keep your Client Secret private. Never commit it to source control or expose it in client-side code.

5. Authorize the App

Generate a random state value:

export DIGITS_STATE="$(openssl rand -hex 16)"

Print the authorization URL, then copy it into your browser and approve the app:

echo "https://connect.digits.com/v1/oauth/authorize?response_type=code&client_id=${DIGITS_CLIENT_ID}&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fcallback&scope=ledger%3Aread&state=${DIGITS_STATE}"
📘

After approval, the browser will try to open http://localhost:3000/callback. For this quickstart, nothing is listening there, so the page is expected not to load. Keep the page open—the authorization code is available in the address bar. A real integration should handle this redirect at its own callback endpoint.

The address will look like this:

http://localhost:3000/callback?code=<authorization_code>&state=<state>

Confirm that the returned state exactly matches the value printed by this command:

echo "${DIGITS_STATE}"

Then copy the code value from the address bar:

export DIGITS_AUTH_CODE="<authorization_code>"

6. Exchange the Code for an Access Token

Authorization codes are short-lived and can only be used once. Exchange the code immediately:

curl --request POST \
  --url https://connect.digits.com/v1/oauth/token \
  --header 'Content-Type: application/json' \
  --data "{
    \"grant_type\": \"authorization_code\",
    \"client_id\": \"${DIGITS_CLIENT_ID}\",
    \"client_secret\": \"${DIGITS_CLIENT_SECRET}\",
    \"code\": \"${DIGITS_AUTH_CODE}\",
    \"redirect_uri\": \"${DIGITS_REDIRECT_URI}\"
  }"

Copy the access_token from the response:

export DIGITS_ACCESS_TOKEN="<access_token>"

7. Make Your First Request

Use the access token to fetch information about the sandbox company:

curl --request GET \
  --url https://connect.digits.com/v1/company \
  --header "Authorization: Bearer ${DIGITS_ACCESS_TOKEN}"

A successful response returns company metadata from the sandbox:

{
  "id": "<company_id>",
  "name": "<company_name>",
  "fiscalYearStartMonth": "<month>",
  "earliestTransaction": "<timestamp>",
  "currency": "<currency_code>"
}

You have now authenticated an app and made an API request. See Authentication for token refresh and production guidance.

What's Next

  • Have an Agent help: Point your coding agent at https://developer.digits.com/llms.txt for quick access to these docs and our API reference documentation.
  • Generate a client: Download the OpenAPI YAML files and use OpenAPI Generator, or another compatible tool, to generate a client in your preferred language.
  • Follow a recipe: Browse the Digits recipes for more detailed, step-by-step examples.
  • Explore the API: Use the API Reference to review available endpoints, parameters, and response schemas.

Did this page help you?