WizCommerce SDK is a modular TypeScript/JavaScript client for the WizCommerce API, supporting all major resources (customers, products, orders, invoices, attributes, inventory, payment methods, price lists, product pricing, sales reps, shipments) with type-safe DTOs, pagination, and robust error handling.
npm install wizcommerce
import { WizCommerce } from "wizcommerce";
const wiz = new WizCommerce(WizCommerce.PRODUCTION, "<API_KEY>");
// List customers with pagination
wiz.customer.list({ page: 1, page_size: 20 }).then(console.log);
// Create a customer
wiz.customer
.create({
companyName: "Acme Inc.",
displayName: "Acme",
referenceId: "ACME-001",
email: "[email protected]",
addresses: [
/* ... */
],
contacts: [
/* ... */
],
attributes: [
/* ... */
],
})
.then(console.log);
// Error handling example
wiz.customer.get("bad-id").catch((err) => {
console.error("API error:", err);
});
The WizCommerce SDK provides comprehensive access to all resources in the WizCommerce platform. Each resource has its own detailed documentation page with examples, parameter descriptions, and response formats.
All list methods accept page
and page_size
parameters for paginated results. Example:
wiz.customer.list({ page: 2, page_size: 50 });
All SDK methods throw structured error objects with status codes and messages. Use .catch()
or try/catch for async/await:
try {
await wiz.customer.get("invalid-id");
} catch (error) {
console.error(error.status, error.message);
}
- Issues and feature requests: GitHub Issues
- For questions and support, contact [email protected]
For detailed documentation, see Customer API Documentation.
wiz.customer.list(params?)
wiz.customer.get(id)
wiz.customer.create(data)
wiz.customer.update(id, data)
wiz.customer.delete(id)
For detailed documentation, see Customer Address API Documentation.
wiz.customer.address.list(customerId, params?)
wiz.customer.address.get(customerId, addressId)
wiz.customer.address.create(customerId, data)
wiz.customer.address.update(customerId, addressId, data)
wiz.customer.address.delete(customerId, addressId)
For detailed documentation, see Customer Contact API Documentation.
wiz.customer.contact.list(customerId, params?)
wiz.customer.contact.get(customerId, contactId)
wiz.customer.contact.create(customerId, data)
wiz.customer.contact.update(customerId, contactId, data)
wiz.customer.contact.delete(customerId, contactId)
For detailed documentation, see Product API Documentation.
wiz.product.list(params?)
wiz.product.get(id)
wiz.product.create(data)
wiz.product.update(id, data)
wiz.product.delete(id)
For detailed documentation, see Order API Documentation.
wiz.order.list(params?)
wiz.order.get(id)
wiz.order.create(data)
wiz.order.update(id, data)
wiz.order.delete(id)
wiz.order.patchStatus(id, data)
For detailed documentation, see Invoice API Documentation.
wiz.invoice.list(params?)
wiz.invoice.get(id)
wiz.invoice.create(data)
wiz.invoice.update(id, data)
wiz.invoice.delete(id)
For detailed documentation, see Attribute API Documentation.
wiz.attribute.list(params?)
For detailed documentation, see Inventory API Documentation.
wiz.inventory.list(params?)
wiz.inventory.update(data)
For detailed documentation, see Payment Method API Documentation.
wiz.paymentmethod.list(params?)
wiz.paymentmethod.create(data)
wiz.paymentmethod.delete(id)
For detailed documentation, see Price List API Documentation.
wiz.pricelist.list(params?)
wiz.pricelist.get(id)
wiz.pricelist.create(data)
wiz.pricelist.update(id, data)
wiz.pricelist.delete(id)
For detailed documentation, see Product Pricing API Documentation.
wiz.productpricing.list(params?)
wiz.productpricing.update(id, data)
For detailed documentation, see Sales Rep API Documentation.
wiz.salesrep.list(params?)
For detailed documentation, see Shipment API Documentation.
wiz.shipment.list(params?)
wiz.shipment.get(params)
wiz.shipment.create(data)
wiz.shipment.update(id, data)
wiz.shipment.delete(params)