Extract Orders from Vietnamese Chat Messages Online
Turn a chat or livestream comment ("chốt 2 áo đen size M, ship 12 Lê Lợi…, 0909…") into an order: phone, name, address, items, payment, notes.
Result
Press “Run” to see the result.
Send the text of a Facebook / Zalo / livestream comment or chat message and get a structured order: the customer phone (normalised, E.164, network), name (after "tên:", "người nhận", or a title such as chị / anh), the delivery address resolved to the current ward and province by the same engine as /v1/address-parse (old 3-level addresses are converted to the post-07/2025 units), the items with quantity, size and colour, the payment method (COD, bank transfer, already paid) and delivery notes ("giao giờ hành chính", "gọi trước").
Without a catalog the API reads product codes (A12 x2, MS05 sl 3, #23) and free text ("2 áo đen size M"). With catalog ([{"sku", "name", "aliases"?, "price"?}], up to 500) it matches SKUs, names and aliases (accents and case ignored, partial names allowed) and computes line totals. Every field carries a confidence; is_order tells whether the message looks like an order.
Rule-based, no AI model and no storage: results are fast and predictable, but messy text can be misread, so keep a human check for low-confidence fields. Normalise teencode first with /v1/vn-teencode for very informal messages. Batch up to 100 messages with messages.
Use this in your code
curl -X POST "https://apibox.io.vn/v1/vn-order-extract" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"chốt 2 áo đen size M + 1 quần L, ship 12 Lê Lợi P. Bến Thành, Q1, TPHCM, 0909 123 456, COD"}'const res = await fetch('https://apibox.io.vn/v1/vn-order-extract', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"text": "chốt 2 áo đen size M + 1 quần L, ship 12 Lê Lợi P. Bến Thành, Q1, TPHCM, 0909 123 456, COD"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/vn-order-extract",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"text": "chốt 2 áo đen size M + 1 quần L, ship 12 Lê Lợi P. Bến Thành, Q1, TPHCM, 0909 123 456, COD"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/vn-order-extract');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"text":"chốt 2 áo đen size M + 1 quần L, ship 12 Lê Lợi P. Bến Thành, Q1, TPHCM, 0909 123 456, COD"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
Does it use AI?
No. It is a rule-based extractor (phone patterns, address keywords, the address-parse engine, product code and quantity patterns), so the same input always gives the same output.
Are old addresses converted?
Yes: an address with a district (quận / huyện) is converted to the current phường / xã and province through the official conversion table, as in /v1/address-parse.
How do I match my products?
Pass catalog with your SKUs, names and aliases; matches are accent- and case-insensitive, and prices give line totals and an order total.