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 and management of various Zalo OA features. Specifically, the "Cập Nhật Đơn Hàng" (Update Order) operation allows users to update the status of an existing order in their Zalo OA store.

This node is beneficial for businesses using Zalo OA as a sales channel, allowing them to programmatically update order statuses such as "Pending," "Confirmed," "Shipping," "Delivered," or "Canceled." For example, after processing an order in an external system, you can use this node to update the order status in Zalo OA automatically, ensuring customers receive accurate and timely updates.

Properties

Name Meaning
ID Đơn Hàng The unique identifier of the order to be updated or viewed.
Trạng Thái Đơn Hàng The new status of the order. Options: "Chờ Xác Nhận" (pending), "Đã Xác Nhận" (confirmed), "Đang Giao Hàng" (shipping), "Đã Giao Hàng" (delivered), "Đã Hủy" (canceled).
Lý Do Reason for updating the order status (optional descriptive text).

Output

The node outputs a JSON object containing the response from the Zalo OA API after attempting to update the order. This typically includes confirmation of the update or error details if the update failed.

Example output structure (simplified):

{
  "error": false,
  "message": "Order status updated successfully",
  "order_id": "123456789",
  "status": "confirmed"
}

If an error occurs, the output JSON will contain fields like:

{
  "error": true,
  "message": "Error message describing what went wrong",
  "response": { /* detailed API error response */ },
  "suggestion": "Advice on how to fix 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 endpoints (https://openapi.zalo.me/v3.0/oa).
  • Proper permissions must be granted to the access token to manage orders.
  • No additional external dependencies beyond standard HTTP requests.

Troubleshooting

  • Common Issues:

    • Invalid or expired access token: The API will reject requests if the token is invalid or expired.
    • Incorrect order ID: If the provided order ID does not exist, the API will return an error.
    • Insufficient permissions: The access token must have rights to update orders.
    • Network issues or API downtime.
  • Common Error Messages:

    • "Error updating order: <message>": Indicates failure in the API call; check the message for specifics.
    • API response errors may include HTTP status codes and detailed messages in the response field.
  • How to Resolve:

    • Verify that the access token is valid and has the necessary permissions.
    • Confirm the order ID exists and is correct.
    • Ensure the status value is one of the allowed options.
    • Check network connectivity and retry if transient errors occur.
    • Review the detailed error response for specific API-related issues.

Links and References

Discussion