Đơn Giản & Linh Hoạt

API RESTful dễ tích hợp, hỗ trợ đồng bộ đơn hàng từ Shopify và Magento chỉ trong vài bước.

Bảo Mật Cao

Sử dụng HTTPS và OAuth 2.0 để đảm bảo an toàn dữ liệu khi truyền tải giữa các hệ thống.

Hỗ Trợ Nhanh Chóng

Liên hệ qua Zalo hoặc email để được hỗ trợ cấu hình API trong 24h.

Hướng Dẫn Tích Hợp API

TingtingPOS cung cấp API RESTful để kết nối với Shopify và Magento, cho phép tạo đơn hàng và đồng bộ dữ liệu. Dưới đây là các bước cơ bản:

  1. Lấy API KeySecret từ TingtingPOS (liên hệ qua Zalo: 0934880855).
  2. Cấu hình API Shopify/Magento để lấy dữ liệu đơn hàng.
  3. Gửi yêu cầu POST đến API TingtingPOS để tạo đơn hàng.
Xem Chi Tiết
TingtingPOS API
API Code Example

Chi Tiết Tích Hợp

Shopify API

Lấy dữ liệu đơn hàng từ Shopify:


$shopify_url = "https://your-shop-name.myshopify.com/admin/api/2023-01/orders.json";
$headers = [
    "X-Shopify-Access-Token: your_access_token",
    "Content-Type: application/json"
];
$ch = curl_init($shopify_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$orders = json_decode($response, true);
                    

Magento API

Lấy dữ liệu đơn hàng từ Magento:


$magento_url = "https://your-magento-store.com/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=status&searchCriteria[filter_groups][0][filters][0][value]=pending";
$headers = [
    "Authorization: Bearer your_access_token",
    "Content-Type: application/json"
];
$ch = curl_init($magento_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$orders = json_decode($response, true);
                    

TingtingPOS API

Tạo đơn hàng trong TingtingPOS:


$tingtingpos_url = "https://api.tingtingpos.com/v1/orders";
$headers = [
    "Authorization: Bearer your_tingtingpos_api_key",
    "Content-Type: application/json"
];
$data = [
    "order" => [
        "customer_name" => "Nguyen Van A",
        "customer_phone" => "0901234567",
        "items" => [
            [
                "product_id" => "12345",
                "quantity" => 2,
                "price" => 100000
            ]
        ],
        "total_amount" => 200000,
        "status" => "pending"
    ]
];
$ch = curl_init($tingtingpos_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
echo $result['message'];