githubEdit

Client SDKs

An official client SDK for fulfillmenttools is provided, and clients can also be generated using third-party tools.

fulfillmenttools SDK

The official fulfillmenttools client SDK in TypeScript is available on GitHubarrow-up-right and npmarrow-up-right and can be used wherever you run JavaScript.

The TypeScript SDK is open source and licensed under the MIT License, so you can use it in your projects and contribute to its development.

circle-info

Learn how to set up and use the TypeScript SDK with the tutorial on GitHubarrow-up-right.

Currently, this client SDK doesn't provide access to all of our API's features, but we're continuously extending it and releasing new versions. We welcome your feedback.

Client generation

Another approach is to use Swagger Codegenarrow-up-right, which can generate client SDKs from our OpenAPI specification.

Other tools, such as the OpenAPI Generatorarrow-up-right, can also be used. It is also possible to opt out of generating classes or types and instead manually model the required components for a specific use case.

circle-info

The Swagger Codegen GitHub repositoryarrow-up-right has more details on this tool.

TypeScript example

Here's an example workflow to generate a TypeScript client from our OpenAPI specification:

1

Follow prerequisites

Follow the Swagger Codegen CLI Tool instructionsarrow-up-right on GitHub.

2

Download the OpenAPI specification

Download the fulfillmenttools OpenAPI specification:

  • https://raw.githubusercontent.com/fulfillmenttools/fulfillmenttools-api-reference/master/api.swagger.yaml

3

Generate the TypeScript client

Use the Swagger Codegen CLI tool to generate a TypeScript client. Example command:

Generate TypeScript client
java -jar swagger-codegen-cli-3.0.62.jar generate \
  -i api.swagger.yaml \
  -l typescript-fetch \
  -o client

This will put the generated classes into the client folder. In this folder, the api.ts file contains the generated namespaces, interfaces, and related code that are especially relevant.

4

Review and integrate

Depending on your preferences, you can:

  • Use all the generated client classes

  • Pick only the generated enum, interface, namespace, type definitions, and implement the actual client yourself

TypeScript example

This example demonstrates how to generate a TypeScript client:

  1. Download the fulfillmenttools OpenAPI specification api.swagger.yamlarrow-up-right.

  2. Use the Swagger Codegen CLI tool to generate a TypeScript client:

  3. This command generates the client classes in the client folder. Within this folder, the api.ts file contains the generated namespaces and interfaces.

  4. It is possible to use all the generated client classes, or to selectively use the generated enum, interface, namespace, and type definitions to implement a custom client.

Last updated