Getting Started

Get your API key from Duplo Dashboard, authenticate your first request, and configure the credential.

Duplo Dashboard is Duplo's enterprise solution for managing business operations and spending. This page covers the setup every integration shares: getting a credential from the dashboard, authenticating with it, and configuring what it can do.

Everything here runs against one base URL:

Base URL
https://spend-api.tryduplo.com

Prerequisites

Your business must be ready in Duplo Dashboard before the API will accept a call:

  • The business is active in Duplo Dashboard.
  • Your business has Developer API enabled. If it is not, contact support to request access.
  • Your role in Duplo Dashboard allows you to generate API keys.

Getting your API credentials

API keys are not generated through this API. They are issued from Duplo Dashboard itself.

Log in, go to Settings › Developer API, and generate a key. Give it a label naming the integration it serves, choose its scopes, and confirm with your two-factor authentication code. That issues two values:

  • API key, prefixed pk_live_ or pk_test_. The credential that authenticates every request.
  • Client secret key, prefixed sk_live_ or sk_test_. Used to encrypt request bodies if you turn on field-level request encryption, and to verify e-invoicing webhooks.

Both are shown once, at creation time, and never again, so store them securely before you leave the page.

You can hold up to 10 active keys in each mode, so give each integration its own key with only the scopes it needs. Generating a key leaves your other keys working.

To rotate a key, generate a new one, move your integration onto it, then revoke the old one. A key you deactivate stops working until you reactivate it, while a revoked key is gone for good. Each key belongs to the user who generated it, and you can manage only your own.

The prefix carries the mode, so a pk_test_ key does not authenticate live traffic and a pk_live_ key does not reach test data.

Authenticating your requests

Every endpoint takes your API key as a bearer token:

Required on every request
Authorization: Bearer <apiKey>

Three errors are common to every endpoint, whatever it does:

StatusMessageCause
401Missing API keyNo Authorization: Bearer header
401Invalid API keyThe key is unknown, deactivated, revoked, or belongs to the other mode
403API access is not enabled for this businessDeveloper API is off for your business
403This IP address is not permitted to use this API keyYour allowlist is non-empty and the caller's IP is not on it
403API key is missing required scopeThe key's scopes do not cover this endpoint; requiredScope names the one it needs
429Rate limit exceededMore than 100 requests in 60 seconds, counted per business per mode

Send request bodies as plain JSON, exactly as shown throughout the guides, unless you turned on field-level encryption, in which case they are wrapped in an encrypted envelope.

Scopes, the IP allowlist, and the rate limit behind that 429 are covered in Restrict your API key. Calls that move money can also require a signature, covered in Sign your requests.

How is this guide?

Last updated on

On this page

Need help? Visit our help center