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 programmatically create an order on behalf of a user within the Zalo ecosystem.

This operation is useful for businesses that want to automate order creation from their Zalo Official Account, such as when receiving orders via chat or other channels integrated with n8n. For example, after collecting customer details and product selections, this node can submit the order directly to Zalo's store system, streamlining order processing workflows.

Properties

Name Meaning
User ID The ID of the user placing the order
Tên Người Nhận Recipient's full name
Số Điện Thoại Recipient's phone number
Địa Chỉ Giao Hàng Shipping address
Thành Phố City for shipping
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)
- Giá (Price)
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

Output

The output JSON contains the response from the Zalo Official Account API after attempting to create the order. This typically includes:

  • Confirmation of order creation status.
  • Details about the created order or error information if the request failed.

If the order creation fails, the output JSON will include an error flag set to true, an error message, and possibly additional response data from the API to help diagnose the issue.

The node does not output binary data for this operation.

Dependencies

  • Requires an API authentication token (access token) for the Zalo Official Account API.
  • The node uses the official Zalo OA API endpoint at https://openapi.zalo.me/v2.0/oa.
  • Proper permissions must be granted to the access token to allow order creation.
  • No additional external dependencies beyond standard HTTP requests.

Troubleshooting

  • Common issues:

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

    • Errors returned by the API are included in the output JSON under message and response fields.
    • Typical error messages may indicate invalid parameters, permission denied, or server errors.
  • Resolution tips:

    • Verify the access token is valid and has the necessary scopes.
    • Ensure all required input properties are correctly filled.
    • Check product IDs and quantities for correctness.
    • Review API documentation for any changes or additional requirements.
    • Inspect the detailed API response included in the output for clues.

Links and References

Discussion