1.0.5 • Published 1 year ago

youcan v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

youcan is a package allows the developer to interact easily with the YouCan API.

NPM Version NPM Install Size NPM Downloads

Installation

Either through cloning with git or by using npm (the recommended way):

npm install youcan # or using yarn: yarn add youcan

Example Usage

import YouCan from "youcan";

const myStore = new YouCan("YOUCAN_STORE_ACCESS_TOKEN");

myStore.products
	.getAllProducts()
	.then((products) => {
		console.log(products.data);
	})
	.catch((error) => {
		console.error(error.response.data);
	});

See all examples Here

Products

Product ActionResponsable Method
Get All ProductsmyStore.products.getAllProducts()
Get Products with sort, include, limit and pagemyStore.products.getProducts({ })
Get Product By IDmyStore.products.getProductById("PRODUCT_ID")
Create ProductmyStore.products.createProduct(productData)
Update ProductmyStore.products.updateProduct("PRODUCT_ID", productData)

See Example

See Products documentation

Orders

Order ActionResponsable Method
Get All OrdersmyStore.orders.getAllOrders()
Get Orders with sort, include, limit and pagemyStore.orders.getOrders({ })
Get Order By IDmyStore.orders.getOrderById("ORDER_ID")
Create OrdermyStore.orders.createOrder(orderData)
Close OrdermyStore.orders.closeOrder(orderData)
Fulfill OrdermyStore.orders.fulfillOrder({ orderId: "ORDER_ID" })
Pay OrdermyStore.orders.payOrder("ORDER_ID")

See Example

See Orders documentation

Reviews

Reviews ActionResponsable Method
Get All ReviewsmyStore.reviews.getAllReviews()
Get Reviews with sort, include, limit and pagemyStore.reviews.getReviews({ })
Get Review By IDmyStore.reviews.getReviewById("REVIEW_ID")
Create ReviewmyStore.reviews.createReview("PRODUCT_ID", reviewData)
Update ReviewmyStore.reviews.updateReview("REVIEW_ID", reviewData)
Delete ReviewmyStore.reviews.deleteReview("REVIEW_ID")
Get Product Reviews with sort, include, limit and pagemyStore.reviews.getReviewsByProductId("PRODUCT_ID", {})
Get All Product ReviewsmyStore.reviews.getAllReviewsByProductId("PRODUCT_ID")
Reject ReviewmyStore.reviews.rejectReview("REVIEW_ID")
Approve ReviewmyStore.reviews.approveReview("REVIEW_ID")

See Example

See Reviews documentation

Categories

Categories ActionResponsable Method
Get All CategoriesmyStore.categories.getAllCategories()
Get Categories with sort, include, limit and pagemyStore.categories.getCategories({ })
Get Category By IDmyStore.categories.getCategoryById("CATEGORY_ID")
Create CategorymyStore.categories.createCategory(categoryData)
Update CategorymyStore.categories.updateCategory("CATEGORY_ID", categoryData)
Delete CategorymyStore.categories.deleteCategory("CATEGORY_ID")

See Example

See categories documentation

Coupons

Coupons ActionResponsable Method
Get All CouponsmyStore.coupons.getAllCoupons()
Get Coupons with sort, include, limit and pagemyStore.coupons.getCoupons({ })
Get Coupon By IDmyStore.coupons.getCouponById("COUPON_ID")
Create CouponmyStore.coupons.createCoupon(couponData)
Update CouponmyStore.coupons.updateCoupon("COUPON_ID", couponData)
Delete CouponmyStore.coupons.deleteCoupon("COUPON_ID")

See Example

See Coupons documentation

Customers

Customers ActionResponsable Method
Get All CustomersmyStore.customers.getAllCustomers()
Get Customers with sort, include, limit and pagemyStore.customers.getCustomers({ })
Get Customer By IDmyStore.customers.getCustomerById("CUSTOMER_ID")
Create CustomermyStore.customers.createCustomer(customerData)
Update CustomermyStore.customers.updateCustomer("CUSTOMER_ID", customerData)
Delete CustomermyStore.customers.deleteCustomer("CUSTOMER_ID")

See Example

See Customers documentation

Languages

Languages ActionResponsable Method
Get All LanguagesmyStore.languages.getLanguages()
Set Default LanguagesmyStore.languages.setLanguageDefault("LANGUAGE_ID")

See Example

See Languages documentation

Menus

Menus ActionResponsable Method
Get All MenusmyStore.menus.getMenus()
Get Menu By IDmyStore.menus.getMenuById("MENU_ID")
Create MenumyStore.menus.createMenu(menuData)
Update MenumyStore.menus.updateMenu("MENU_ID", menuData)

See Example

See Menus documentation

Pages

Pages ActionResponsable Method
Get All PagesmyStore.pages.getAllPages()
Get Customers with sort, include, limit, page, searchmyStore.pages.getPages({ })
Get Page By IDmyStore.pages.getPageById("PAGE_ID")
Create PagemyStore.pages.createPage(pageData)
Update PagemyStore.pages.updatePage("PAGE_ID", pageData)
Delete PagemyStore.pages.deletePage("PAGE_ID")

See Example

See Pages documentation

Rest Hooks

Rest Hooks ActionResponsable Method
Get All Rest HooksmyStore.resthooks.getAllResthooks()
Subscribe to event HookmyStore.resthooks.resthookSubscribe("EVENT", "TARGET_URL")
Unsubscribe from event HookmyStore.resthooks.resthookUnsubscribe("RESTHOOK_ID")

See Example

See Rest Hooks documentation

Product Inventory

Product Inventory ActionResponsable Method
Incerement Product InventorymyStore.productInventory.IncrementProductInventory("PRODUCT_ID", inventoryData)
Decerement Product InventorymyStore.productInventory.DecrementProductInventory("PRODUCT_ID", inventoryData)

See Example

See Product Inventory documentation

Shipping Zones

Shipping Zones ActionResponsable Method
Get All Shipping ZonesmyStore.coupons.getAllShippingZones()
Get Shipping Zones with sort, include, limit and pagemyStore.coupons.getShippingZones({ })
Get Shipping Zone By IDmyStore.coupons.getShippingZoneById("SHIPPING_ZONE_ID")
Create Shipping ZonemyStore.coupons.createShippingZone(shippingZoneData)
Update Shipping ZonemyStore.coupons.updateShippingZone("SHIPPING_ZONE_ID", shippingZoneData)
Delete Shipping ZonemyStore.coupons.deleteShippingZone("SHIPPING_ZONE_ID")
Create Shipping RatemyStore.coupons.createShippingRate("SHIPPING_ZONE_ID", shippingRatesDate)
Update Shipping RatemyStore.coupons.createShippingRate("SHIPPING_ZONE_ID", shippingRatesDate)

See Example

See Shipping Zones documentation

Store

Store ActionResponsable Method
Get Store DetailsmyStore.store.getDetails()
Get Store PacksmyStore.store.getPacks()
Get Store ProfitmyStore.store.getProfit()
Create Support TicketmyStore.store.createSupportTicket(ticketData)

See Example

See Store documentation

Upsells

Upsells ActionResponsable Method
Get All UpsellsmyStore.coupons.getAllUpsells()
Get Upsells with limit and pagemyStore.coupons.getUpsells({ })
Get Upsell By IDmyStore.coupons.getUpsellById("UPSELL_ID")
Create UpsellmyStore.coupons.createUpsell(upsellData)
Update UpsellmyStore.coupons.updateUpsell("UPSELL_ID", upsellData)
Delete UpsellmyStore.coupons.deleteUpsell("UPSELL_ID")

See Example

See Upsells documentation

Support

This package costs me time to make and maintain every time.

I am very 😀 about every coffee!

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago