fulfillmenttools
API documentationIncident ManagementFeedback
Developer Docs
Developer Docs
  • Developer docs
  • Getting Started
    • Quickstart
    • Integration tutorial
      • Adding facilities
      • Adding listings to facilities
      • Configuring stocks
      • Carrier configuration
      • Placing orders
      • Checkout options
      • Distributed Order Management System (Routing)
      • Local fulfillment configuration
    • Free trial
  • Technical Basics
    • Access to fulfillmenttools
    • Feature status
    • Available regions
    • Backup policies
  • Connecting to fulfillmenttools
    • Client SDKs
    • commercetools connect
    • OpenID connect
      • Configure Microsoft Entra ID / Azure Active Directory
      • Configure Keycloak
  • API
    • Core concepts
      • Authentication & authorization
      • API Versioning & lifecycle
      • Assign user to jobs
      • Localization
      • Resource timestamps
      • Custom attributes
      • Article attributes
      • Recordable attributes
      • Data update guarantees
      • Rate limits & scaling
      • Retries
      • Performance on test vs. production systems
      • Load testing
    • API calls
      • Postman
      • cURL
      • GraphQL Explorer
    • GraphQL API
    • RESTful API
      • Pagination interface
      • RapiDoc
      • OpenAPI 3.0 Spec
    • Eventing
      • Structure of an event
      • Available events
        • Event flows
      • Eventing example
      • Event export
  • Integration Guides
    • Basics
      • Article categories
      • Audits
      • Facilities
      • Facility groups
      • GDPR configuration
      • Listings
      • Remote configuration
      • Receipts
      • Search
      • Subscribe to events
      • Sticker
      • Stocks
      • Storage locations
      • Tags
      • Users
    • Channel inventory
    • Facility discounts
    • Inbound process
    • Outbound stocks
    • Purchase order
    • Receipt
    • Routing strategy
    • Show sticker to clients
    • Stow jobs
  • More Integration Guides
    • Carrier management
      • Introduction to carrier configuration
      • Required data when operating carriers
      • Adding & connecting carriers to facilities
      • Custom carrier
    • Configurations for order fulfillment
      • Picking configuration
      • Packing configuration
      • Handover configuration
      • Printing and document configuration
      • Packing container types
      • Parcel tag configuration
      • Headless order fulfillment
      • Short-pick reasons
      • External documents in order fulfillment
      • Service jobs
      • Load units
      • Running sequence
    • DOMS - distributed order management system (routing)
    • External actions
    • Interfacility transfer
    • Notifications
    • Orders
      • Place your first order
      • Ship-from-store orders
      • Click-and-collect orders
      • Locked orders
      • Order with custom services
      • Bundled items in an order
      • Order process status
    • Availability & promising
    • Returns
Powered by GitBook
On this page
  • fulfillmenttools GraphiQL
  • Altair
  • Pre-Request Script for Altair
Edit on GitHub
  1. API
  2. API calls

GraphQL Explorer

PreviouscURLNextGraphQL API

Last updated 4 months ago

fulfillmenttools GraphiQL

The official fulfillmenttools playground, powered by GraphiQL, is hosted under https://{YOUR_TENANT}.graphql.fulfillmenttools.com/graphql . It enables interactive exploration of queries and docs, with more features coming soon. Auth tokens must be entered in the header tab at the bottom of the page.

Altair

To start with Altair, enter your tenant's GraphQL URL in the URL bar. Please remember that using Altair for schema introspection will not include schema directives and lifecycle information from generated GraphQL schemas.

Pre-Request Script for Altair

The following guide shows how to set up a pre-request script in Altair.

First, create a new environment for your tenant:

Fill the following information:

{
  "user": "YOUR-USER-EMAIL",
  "password": "YOUR-PASSWORD",
  "host": "https://YOUR-TENANT-NAME.graphql.fulfillmenttools.com/graphql",
  "apiKey": "YOUR-API-KEY"
}

Next, add the following Pre-request script in the Pre-request tab. Don't forget to enable it.

const lastTokenCall = await altair.storage.get("lastTokenCall");
const now = new Date();
if (!lastTokenCall || now - (new Date(lastTokenCall)) > 1800000) {
  altair.log("Refreshing token...");
  var user = altair.helpers.getEnvironment('user');
  var apiKey = altair.helpers.getEnvironment("apiKey");
  var escapedPwd = altair.helpers.getEnvironment('password');
  escapedPwd = escapedPwd.replace(/\\/g, '\\\\');
  escapedPwd = escapedPwd.replace(/\'/g, '\\\'');
  escapedPwd = escapedPwd.replace(/\"/g, '\\\"');
  escapedPwd = escapedPwd.replace(/\`/g, '\\\`');
  await altair.storage.set("lastTokenCall", new Date());
  const authUrl = 'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=' + apiKey
  const authResult = await fetch(authUrl, {
        "method": "POST",
        "body": JSON.stringify({
          "email": user,
          "password": escapedPwd, 
          "returnSecureToken": true
        })
  }).catch((e) => altair.log(e))
  const data = await authResult.json()
  altair.helpers.setEnvironment("authToken", data.idToken, true);
  altair.helpers.setEnvironment("refreshToken", data.refreshToken, true);
}

Finally, adjust the Authentication header to use the automatically generated token:

Now it should work and automatically refresh the token when it’s older than 30 Minutes. Have fun!

For in-depth query development on top of our GraphQL API, we recommend , available as a browser plugin and standalone application. We also provide a pre-request script to automatically refresh auth tokens, similar to our Postman collection.

Altair
The fulfillmenttools GraphiQL Playground
Working with the fulfillmenttools GraphQL API in Altair
Creating a new environment in altair