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(defaulthttps://mashroo3.net) -
timeoutMs(default30000) -
fetchcustom fetch implementation
Error handling
SDK throws Mashroo3Error with message, status, and data.