zalora-api-sdk
v1.0.0
Published
Mode.js SDK for managing the Zalora Seller Center API as per the [Zalora Seller Center API documentation](https://sellercenter-api.zalora.com/docs/).
Downloads
74
Readme
Zalora API SDK
Mode.js SDK for managing the Zalora Seller Center API as per the Zalora Seller Center API documentation.
Table of Contents
- Installation
- Usage
- API Overview
- Request and Response Interfaces
- Examples
- Documentation
- Contributing
- License
Installation
- Clone the repository:
git clone https://github.com/ghaowei08/zalora-api-sdk
- Install dependencies:
yarn
- Compile TypeScript::
yarn build
Usage
Initializing the SDK:
Create an instance of the ZaloraInstance
by passing your credentials and configuration:
const clientId = process.env.clientId ?? "";
const clientSecret = process.env.clientSecret ?? "";
const accessToken = process.env.accessToken ?? "";
const zalora = new ZaloraInstance({ country: Country.GSC, environment: Environment.Production, clientId, clientSecret, accessToken });
Fetching an Access Token:
To authenticate and obtain an access token, use:
await zalora.auth.getAccessToken();
Sending API Requests
Example of fetching categories with pagination:
await zalora.category.getCategories({limit: 100, offset: 0});
API Overview
Endpoints
The SDK automatically determines the appropriate global and environment-specific endpoints based on the country
and environment
parameters provided during initialization.
Request and Response Interfaces
Interface Structure
All API requests and responses are strictly typed using TypeScript interfaces to ensure type safety and clarity.
Examples
Explore more usage examples in the examples
directory or refer to the Documentation.
Documentation
Comprehensive documentation can be found in the docs
folder, which includes:
order_status_flow.png
: A visual guide to the order status flow.openapi-standalone.yml
: The original API OpenAPI specification for reference.
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (feature/your-feature).
- Commit your changes.
- Push to the branch.
- Create a pull request.
License
This project is licensed under the MIT License.