Harmony SDK
Harmony SDK is a TypeScript library for interacting with the Harmony API. It provides a set of modules to perform various operations such as authentication, stock lookup, stock level lookup, point of sale operations, carrier management, diary management, and gift voucher handling.
Table of Contents
Installation
To install the Harmony SDK, use the following command:
npm install @dotdev/harmony-sdk
or if you're using pnpm:
pnpm add @dotdev/harmony-sdk
Usage
Here's a basic example of how to use the Harmony SDK:
import { HarmonyAPI, AuthenticationToken } from "@dotdev/harmony-sdk";
const api = new HarmonyAPI("https://your-harmony-api-url.com");
async function main() {
const authToken: AuthenticationToken = {
};
try {
const sessionId = await api.authenticate(authToken);
console.log("Authenticated successfully. Session ID:", sessionId);
const stockLookupParams = {
};
const stockResults = await api.stockLookup(stockLookupParams, sessionId);
console.log("Stock lookup results:", stockResults);
} catch (error) {
console.error("Error:", error);
}
}
main();
Development
To set up the development environment:
Implemented Endpoints
The Harmony SDK implements the following endpoints:
For detailed information on each endpoint and its parameters, please refer to the source code and type definitions.