Zalo OA icon

Zalo OA

Tương tác với Zalo Official Account API

Overview

The "Zalo OA" node integrates with the Zalo Official Account API, enabling automation of various interactions and management tasks related to a Zalo Official Account. Specifically, the "Tạo Đơn Hàng" (Create Order) operation allows users to create an order on behalf of a user within the Zalo ecosystem.

This operation is useful for businesses that want to automate order creation directly from workflows, such as processing orders received via chatbots or other channels integrated with Zalo. For example, after collecting order details from a customer through a chatbot, this node can be used to submit the order to the Zalo store system automatically.

Properties

Name Meaning
User ID The ID of the user placing the order
Tên Người Nhận The name of the recipient who will receive the shipment
Số Điện Thoại The phone number of the recipient
Địa Chỉ Giao Hàng The shipping address where the order will be delivered
Thành Phố The city for the shipping address (optional)
Danh Sách Sản Phẩm List of products in the order; each product includes:
- ID Sản Phẩm: Product ID
- Số Lượng: Quantity of the product
- Giá: Price of the product
Phí Vận Chuyển Shipping fee amount
Giảm Giá Discount amount applied to the order
Tổng Tiền Total amount of the order including products, shipping fee, and discount

Output

The output JSON contains the response data returned by the Zalo Official Account API after attempting to create the order. This typically includes confirmation details about the created order or error information if the request failed.

If the order creation is successful, the output will include order identifiers and status information. In case of failure, the output JSON will contain an error flag, an error message, and possibly additional response details from the API to help diagnose the issue.

Dependencies

  • Requires an API access token credential for authenticating requests to the Zalo Official Account API.
  • Uses the official Zalo OA API endpoint at https://openapi.zalo.me/v3.0/oa.
  • The node depends on the axios library for HTTP requests.
  • Proper permissions must be granted to the API token to allow order creation operations.

Troubleshooting

  • Common Issues:

    • Invalid or expired access token leading to authentication errors.
    • Missing required fields such as user ID or shipping information causing validation errors.
    • Incorrect product IDs or malformed product list resulting in API rejection.
    • Insufficient permissions for the API token to create orders.
  • Error Messages:

    • Errors returned from the API are included in the output JSON under error and message fields.
    • If the API returns an error, check the response field for detailed API response data.
    • Typical suggestions include verifying all input parameters, ensuring the access token is valid and has necessary scopes, and confirming that product IDs exist in the Zalo store.
  • Resolution Steps:

    • Double-check all required input properties are provided and correctly formatted.
    • Ensure the API token is current and has the correct permissions.
    • Review API response messages for specific error codes or messages.
    • Consult Zalo OA API documentation for any changes or updates to the order creation endpoint.

Links and References

Discussion