WooCommerce
Interact with WooCommerce stores via REST API
How it Works
The WooCommerce component talks to your online store using WooCommerce’s REST API. When you set it up, you choose a stored credential that contains the store’s URL and the API keys. The component then sends HTTP requests to the store’s endpoints to read, create, update, or delete data such as products, orders, customers, and more. All communication happens over HTTPS, so your data stays secure while it travels between Nappai and WooCommerce.
Operations
This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:
- Get: Retrieve information from your WooCommerce store, such as a list of products or a single order.
- Create: Add a new entity (product, order, customer, etc.) to your store.
- Update: Modify an existing entity in your store.
- Delete: Remove an entity from your store.
To use the component, first select the operation you need in the “Operation” field.
Inputs
Mapping Mode
This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
The following fields are available to configure this component. Each field may be visible in different operations:
-
Credential: Select a previously configured WooCommerce API credential.
- Visible in: Get, Create, Update, Delete
-
Operation: Choose the action you want to perform.
- Visible in: Get, Create, Update, Delete
-
Entity: Pick the type of data you want to work with (e.g., Product, Order, Customer).
- Visible in: Get, Create, Update, Delete
-
Entity ID: The unique identifier of the entity you want to retrieve, update, or delete.
- Visible in: Get
-
Data: The information you want to send when creating or updating an entity.
- Visible in: Create, Update, Delete
-
Limit: How many entities to return when you’re getting a list.
- Visible in: Get
-
Order By: Field to order results by (prepend with
-
for descending order, e.g.,-date
).- Visible in: Get
-
Search: Look for something specific? Enter a word or phrase. Only items containing this text will be shown. Leave empty to not filter by search.
- Visible in: Get
-
Mapping Mode: Enable mapping mode to process multiple data records in batch.
- Visible in: Get, Create, Update, Delete
Outputs
- Result: The data returned from WooCommerce after performing the chosen operation. This can be a list of entities, a single entity, or a confirmation of a create/update/delete action. The output is in a standard data format that can be fed into other components in your workflow.
Usage Example
Scenario: You want to pull the latest 10 products from your WooCommerce store and then create a new product.
-
Get Products
- Operation: Get
- Entity: Product
- Limit: 10
- Mapping Mode: Off
- Click Run. The component returns a list of products in the Result output.
-
Create a New Product
- Operation: Create
- Entity: Product
- Data: Provide the product details (name, price, stock, etc.) either as Fixed values or mapped from another component.
- Mapping Mode: Off
- Click Run. The component returns the newly created product in the Result output.
You can chain these two steps together in a single workflow, using the output of the Get step as input for the Create step if needed.
Related Components
- Shopify – Connect to Shopify stores via REST API.
- Magento – Manage Magento e‑commerce data.
- Google Sheets – Read and write spreadsheet data.
- Email – Send notifications or alerts.
Tips and Best Practices
- Use Mapping Mode for bulk operations – When you need to process many records at once, enable Mapping Mode and connect the component to a data source that streams records.
- Test with a small limit first – When using the Get operation, start with a low limit (e.g., 5) to confirm the connection before pulling large lists.
- Keep credentials secure – Store your WooCommerce API keys in Nappai’s credential manager and never expose them in your workflow.
- Validate data before creating or updating – Use a validation component to ensure the data you send matches WooCommerce’s required format.
- Handle pagination – If you need more than the maximum limit, use the component’s pagination features or loop the Get operation with updated offsets.
Security Considerations
- All API calls are made over HTTPS, protecting data in transit.
- Credentials are stored encrypted in Nappai’s credential store and are never exposed in logs.
- When using Mapping Mode, ensure that sensitive data (e.g., passwords, API keys) is not inadvertently passed to other components that might log or expose it.