- Documentation
- Integrations
- Apps
- Magento 2 integration
Magento 2 integration
Sync products, orders, customers and fulfilment between your clients' Magento 2 or Adobe Commerce stores and the rest of their stack.
What it does
Connect a client's Magento 2 or Adobe Commerce store and drive the catalogue, the customer list and the whole order lifecycle from a workflow. You can watch for new orders and push them into a finance or fulfilment system, keep stock levels in step with a supplier feed, create and update products in bulk, and invoice, ship or refund an order without anyone opening the admin. Every action runs against the store's own REST API with an integration token the client controls, so you can manage many client stores side by side without sharing logins.
Connect a Magento store
Magento authenticates with an integration access token, created once in the store's admin and sent as a bearer token on every request.
- In the store's admin, go to System → Extensions → Integrations and choose Add New Integration.
- Name it (for example
TaskJuice) and, under API, grant the resources the workflows need. Granting All is simplest; least privilege works too, as long as it covers Catalog, Sales and Customers. - Save, then choose Activate and approve. Magento shows the Access Token once. Copy it now.
- Turn on bearer-token access. Go to Stores → Configuration → Services → OAuth → Consumer Settings and set Allow OAuth Access Tokens to be used as standalone Bearer tokens to Yes, then flush the cache.
- In TaskJuice, add a Magento connection from any Magento node. Paste the
Store URL (the full storefront URL including
https://, with no trailing slash) and the Access Token.
Step 4 is not optional on Magento 2.4.4 and newer, where the setting is off by
default. With it off, every request fails with a 401 whose body is identical
to the one an unauthenticated request gets, so a perfectly good token looks
broken. If the connection will not authenticate, check this setting first.
Triggers
All Magento triggers poll the store's REST API. Magento offers no webhook subscription an integration can register, so there is nothing to subscribe to. See Why these triggers poll.
Each trigger asks for a Store Host: the store's hostname on its own, such as
shop.example.com, with no https://, port or path. Set it to the same store
the trigger's connection points at.
magento-rest/new-order— a new sales order is placed.magento-rest/order-updated— an existing order changes, which covers status changes, invoices, shipments and refunds. The same order fires again each time it is touched.magento-rest/new-customer— a customer account is created, on the storefront or by an admin.magento-rest/new-product— a product is added to the catalogue.magento-rest/product-updated— a product is edited, including price, status and stock changes.magento-rest/new-invoice— an invoice is created against an order.magento-rest/new-shipment— an order is shipped.magento-rest/new-credit-memo— an order is refunded in whole or in part.
The first cycle after you publish establishes the watermark and emits nothing,
so a new workflow never replays the store's back catalogue. Each trigger emits
one activation per cycle with the new records in items. Add a Loop node set to
items to handle them one at a time, or read the array directly for a digest.
Actions
Products
magento-rest/list-products— search the catalogue with MagentosearchCriteria.magento-rest/get-product— fetch one product by SKU.magento-rest/create-product— create a catalogue product.magento-rest/update-product— change an existing product.magento-rest/delete-product— permanently delete a product.magento-rest/get-product-stock— read a SKU's stock item, including theitem_idthat Update Product Stock needs.magento-rest/update-product-stock— set quantity and availability.magento-rest/assign-product-to-category— add a product to a category.
Customers
magento-rest/search-customers— search customers withsearchCriteria.magento-rest/get-customer— fetch one customer by id.magento-rest/create-customer— create a customer account.magento-rest/update-customer— change a customer.magento-rest/delete-customer— permanently delete a customer account.
Orders
magento-rest/list-orders— search orders withsearchCriteria.magento-rest/get-order— fetch one order with its line items and addresses.magento-rest/get-order-status— read an order's current status code.magento-rest/cancel-order— cancel an order.magento-rest/hold-order— put an order on hold.magento-rest/unhold-order— release an order from hold.magento-rest/add-order-comment— add a status-history comment, optionally changing the status and emailing the customer.magento-rest/invoice-order— create an invoice, optionally capturing payment.magento-rest/ship-order— create a shipment, optionally with tracking.magento-rest/refund-order— create a credit memo against an order.
Invoices, shipments and credit memos
magento-rest/list-invoices— search invoices.magento-rest/get-invoice— fetch one invoice.magento-rest/list-shipments— search shipments.magento-rest/get-shipment— fetch one shipment.magento-rest/add-shipment-track— attach a tracking number to a shipment.magento-rest/list-credit-memos— search credit memos.magento-rest/get-credit-memo— fetch one credit memo.
Categories
magento-rest/list-categories— return the category tree.magento-rest/get-category— fetch one category.magento-rest/create-category— create a category under a parent.
Carts
magento-rest/create-cart— create an empty cart for a customer.magento-rest/get-cart— fetch a cart with its line items and totals.magento-rest/add-cart-item— add a product to a cart.magento-rest/update-cart-item— change a line item's quantity.
Why these triggers poll
Magento Open Source has no webhook subsystem, and the word does not appear anywhere in a store's own API schema. Adobe Commerce adds a Webhooks module, but it is licensed separately, it is synchronous (Commerce waits for your response before finishing the operation, so a slow endpoint slows checkout), it is configured from a file or the admin rather than from the API, and it signs with an asymmetric key. None of that can be registered on a merchant's behalf, so polling is the only approach that works for every store. Every other automation platform polls Magento for the same reason.
To keep the cost down, set the poll interval no tighter than the work actually needs. Five minutes suits order and fulfilment flows; catalogue sync is usually fine at fifteen minutes or more.
Known limitations
- Bearer tokens must be enabled. See step 4 above. This is off by default on Magento 2.4.4 and newer.
- Polling triggers need a plain hostname. A store served on a non-standard
port, or from a subdirectory such as
example.com/shop/, cannot be used with the triggers yet. Actions work in all three cases, because they take the full store URL from the connection. - Creating a product needs an attribute set. Magento will not create a
product without one, and the error it returns is
Invalid product data: %1— Magento never substitutes that placeholder, so the message names no field. Pick the set in Create Product;Defaultis right on a stock store. - Stock updates take two steps. Magento keys the update by stock item, so
run Get Product Stock first to read
item_id, then Update Product Stock. - Some endpoints return a bare id as text. Invoice Order, Ship Order, Refund
Order and Update Product Stock return the new id as a string in
value, while Create Cart returns a number. Both feed straight into another action's id field. - Order actions depend on order state. An order cannot be invoiced once it is cancelled or closed, cannot be shipped without invoiceable items, and cannot be refunded before it is invoiced. Read the order first if the state is uncertain.
- SKU fields are text, not a dropdown. A Magento catalogue can hold hundreds of thousands of products, so a picker could only ever show the first page. Type the SKU or map it from an earlier step.
- Magento sets no API rate limit of its own, but every call is real work on the merchant's server. Keep page sizes and poll frequency modest on a busy store.