Skip to main content

Digit API Access

how to generate API tokens and begin exploring the Digit API

Updated over a month ago

Generating API Tokens

Once your account has been approved for API access, you can generate new API tokens from Settings > API Tokens:

Be sure to expand the Permissions and select the correct ones - we recommend starting with the “read” options:

When you generate the token be sure to copy the value and store it somewhere safe - you won’t be able to access it again later. If you forget it you can Revoke it and generate a new one:

Getting Started

👉 Send API requests to https://api.digit-software.com/

NOTE: Right now API keys won’t work in the interface shown below, but we will be making that functionality available soon. Until then, you can still use the interface to explore the API and use it to create queries and mutations that you can then paste into another tool such as Postman.

Digit’s API GraphQL Documentation: https://api-staging.digit-software.com/

To make API calls, you need to add the authorization to the Headers near the bottom of the page:

authorization

Bearer <see access key info above>

This should allow you to make query requests (Read) using the above syntax. If you want to call mutations (CreateUpdateDelete), you need to switch to the variables tab and provide the inputs required to make the request.

Sample API Calls

An item needs the following IDs to be created:

  • clerkOrganizationId

  • defaultStockUomId (pull from the uoms query. The ID for pairs is listed in the sample below)

An order needs the following IDs to be created:

  • clerkOrganizationId

  • customerId

  • shippingAddressId

  • item ids

You either need to create these customers & addresses as you create the order or fetch them by their name before you create the order.

Some sample mutations with their minimum data input:

Mutation

Input

mutation CreateItem($input: CreateItemInput!) {

createItem(input: $input) {

item {

id

}

}

}

{

"input": {

"name": "Red Socks",

"clerkOrganizationId": "org_2q7ijyFawxyztIITFUnD8l2bjkp",

"defaultStockUomId": "01917ac4-8836-7141-9a22-008e3c1d65bd", // required!

"itemTypes": [

"sell"

],

"sku": "red-socks",

"status": "active",

}

}

mutation CreateOrder($input: CreateOrderInput!) {

createOrder(input: $input) {

order {

id

}

}

}

{

"input": {

"clerkOrganizationId": "org_2q7ijyFawxyztIITFUnD8l2bjkp",

"customerId": null,

"shippingAddressId": null,

"items": [

{

"id": null, // create item before and pull ID

"cost": {

"costAmount": 0.1,

"currencyCode": "USD"

},

"quantity": 10

}

],

"orderStatus": "unfulfilled",

"paymentStatus": "not_paid",

"useShippingAsBilling": true, // then billingAddressId not needed

"orderDate": "2024-08-29T15:04:31.234Z",

}

}

Pro Tip: Install the GraphQL Network Inspector on your browser. Then go to the Digit Staging instance and open the dev console. Observe the requests Digit makes when creating an item or an order to better understand how everything fits together.

Did this answer your question?