Skip to Content
Mashroo3 docs are live. More guides are added weekly.
API & SDKJavaScript SDK

JavaScript SDK (mashroo3)

This page documents the npm package from /Users/ahmad/Code/mashroo3-npm.

Package name: mashroo3

Install

npm install mashroo3

Quick start

CommonJS

const { Mashroo3 } = require("mashroo3"); const client = new Mashroo3("YOUR_API_KEY"); const catalog = await client.catalog.list();

ESM

import Mashroo3 from "mashroo3"; const client = new Mashroo3("YOUR_API_KEY"); const orders = await client.orders.list();

Main methods

await client.catalog.list(); await client.customers.list(); await client.customers.create({ name: "John Doe" }); await client.orders.list(); await client.orders.get(44); await client.orders.create({ customer_id: 12, items: [{ product_id: 1, qty: 2 }] }); await client.orders.refund(44, { items: [{ order_item_id: 101, qty: 1 }] });

Constructor options

  • baseUrl (default https://mashroo3.net)
  • timeoutMs (default 30000)
  • fetch custom fetch implementation

Error handling

SDK throws Mashroo3Error with message, status, and data.

Last updated on