n8n.vn docs
Buy n8n.vnn8n.io Docs
  • 📖Lark Base
  • 📖Lark Messenger
  • 📖Lark Custom Bot
  • 📖Create Custom App
  • 📖Clone file Base and grant permissions
  • 📖Haravan
  • 📖Haravan Trigger
  • 📖NhanhVN
  • 📖NhanhVN Trigger
  • 📖KiotViet
  • 📖Text To Json
  • 📖Lark AI
  • 📖Sapo
  • 📖Sapo Trigger
  • 📖KiotViet To LarkBase
  • ⚙️n8n.vn Change Logs
Powered by GitBook
On this page
  • Events
  • Example Usage
  • 1. Sapo Authentication
  • 2. Sapo Trigger
  • 3. Edit Field node (Set)
  • 4. Sapo node

Sapo Trigger

PreviousSapoNextKiotViet To LarkBase

Last updated 1 year ago

Sapo Trigger on the N8N platform - a powerful workflow automation tool that allows you to create and automate complex workflows with ease. With Sapo Trigger, you have the ability to monitor and react to events and data from Sapo, a popular e-commerce management system. Sapo trigger allows you to create complex automated processes to interact with data from the Sapo system and make your business more efficient and save time.

Webhook: You can find webhooks information for this node

Events

  • Delete Customer

  • Delete Order

  • Delete Product

  • New Cancelled Order

  • New Customer

  • New Fulfilled Order

  • New Order

  • New Paid Order

  • New Partially Fulfilled Order

  • New Product

  • Update Customer

  • Update Order

  • Update Product

Example Usage

This workflow allows you to receive updates when a new product gets added in Sapo Store and use their information to find the product. You can also find the workflow on n8n.io. This example usage workflow would use the following node.

  • Sapo Authentication

  • Sapo Trigger

  • Edit Fields (Set)

  • Sapo

The final workflow should look like the following image.

1. Sapo Authentication

2. Sapo Trigger

  1. Select Create new credential at Credential to connect with field.

Provide your Store Name and Access Token (note: Access Token is the result of the Sapo Authentication node). After that, you can click save to finish creating credentials.

  1. Select 'New Product' from the Events dropdown list, then you only save the workflow, it will automatically register the webhook corresponding to that event.

  2. Click on Execute Node to run the node.

In the screenshot below, you will notice that the node returns the information of the new product that was added to Sapo Store. This output gets passed on to the next node in the workflow.

3. Edit Field node (Set)

We will use the Set node to ensure that only the data that we set in this node gets passed on to the next nodes in the workflow.

  1. Click on Add Value and select 'Number' from the dropdown list.

  2. Enter Product ID in the Name field.

  3. Click on the gears icon next to the Value field and click on Add Expression.

  4. Select the following in the Variable Selector section: Current Node > Input Data > JSON > data > productId. You can also add the following expression: {{$json.id}}.

  5. Click on Add Value and select 'String' from the dropdown list.

  6. Enter Product Name in the Name field.

  7. Click on the gears icon next to the Value field and click on Add Expression.

  8. Select the following in the Variable Selector section: Current Node > Input Data > JSON > data > name. You can also add the following expression: {{$json.name}}.

  9. Select 'Selected Input Fields' from the Include in Output dropdown list. We set this option to true to ensure that only the data that we have set in this node gets passed on to the next nodes in the workflow.

  10. Click on Execute Node to run the node.

In the screenshot below, you will notice that the node uses the data from the previous node and returns the data that we set for the workflow.

4. Sapo node

This node will use the data coming from the previous node to find product in Sapo Store

  1. First of all, you'll have to enter credentials for the Sapo node consisting of Store Name and Access Token (taken from Sapo Authentication) then click Save button.

  2. Select 'Lấy một Product' from the Operation dropdown list.

  3. Enter the Product ID in the Product ID name field.

  4. Click on Execute Node to run the node.

In the screenshot below, you will notice that the node finds the information of a new product by the product name value of the previous node.

Activate workflow for production

You'll need to save the workflow and then click on the Activate toggle on the top right of the screen to activate the workflow. Your workflow will then be triggered as specified by the settings in the Sapo Trigger node.

This node is used to obtain access tokens for Sapo's nodes. This node is used to obtain access tokens for Sapo's nodes. How to prepare and use this node .

📖
here
here