Zalo OA icon

Zalo OA

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

Overview

This node integrates with the Zalo Official Account (OA) API to create an order on behalf of a user. It allows sending detailed order information including recipient details, product list, shipping fees, discounts, and total amount. This is useful for businesses using Zalo OA to manage customer orders directly through their chatbots or automated workflows.

Typical use cases include:

  • Automating order creation when a customer places an order via Zalo chat.
  • Integrating Zalo OA order management into broader e-commerce or CRM workflows.
  • Streamlining order processing by programmatically submitting order data to Zalo OA.

Example: When a customer sends an order request in Zalo chat, this node can be used to create the order in Zalo OA system with all necessary shipping and product details.

Properties

Name Meaning
User ID The ID of the user placing the order.
Tên Người Nhận Recipient's full name for shipping.
Số Điện Thoại Recipient's phone number.
Địa Chỉ Giao Hàng Shipping address where the order should be delivered.
Thành Phố City for the shipping address.
Danh Sách Sản Phẩm List of products included 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 after fees and discounts.

Output

The node outputs JSON data representing the response from the Zalo OA API after attempting to create the order. The structure typically includes:

  • Confirmation of order creation with order details.
  • Status codes and messages indicating success or failure.
  • Error information if the order creation failed.

No binary data output is produced by this operation.

Dependencies

  • Requires an active Zalo Official Account API access token with appropriate permissions to create orders.
  • The node uses HTTP POST requests to the Zalo OA API endpoint /store/order/create.
  • Proper configuration of credentials containing the API key/token is necessary.
  • Network connectivity to https://openapi.zalo.me/v3.0/oa is required.

Troubleshooting

  • Common Issues:

    • Invalid or expired access token leading to authentication errors.
    • Missing or incorrect user ID or product IDs causing API validation failures.
    • Insufficient permissions on the Zalo OA account to create orders.
    • Incorrect formatting of the product list or shipping details.
  • Error Messages:

    • "Error creating order: <message>": Indicates failure during order creation; check parameters and API permissions.
    • HTTP status errors such as 401 Unauthorized or 403 Forbidden suggest token or permission issues.
    • Validation errors returned by the API may indicate missing required fields or invalid data formats.
  • Resolutions:

    • Verify that the API token is valid and has not expired.
    • Ensure all required fields (userId, shippingName, shippingPhone, shippingAddress) are correctly provided.
    • Confirm product IDs exist and quantities/prices are valid numbers.
    • Check Zalo OA API documentation for any changes or additional required parameters.

Links and References

Discussion