Developer Docs

    เริ่มต้น

    Partner API — Auth

    Partner API — Sales

    Partner API — Products

    Partner API — Inventory

    Partner API — Purchasing

    Partner API — Customers

    Partner API — Reports

    Partner API — Webhooks

    อ้างอิง

    List Suppliers

    ดึงรายการ Supplier ทั้งหมดของธุรกิจ

    Suppliers เป็นข้อมูลระดับ Business ไม่แยกตามสาขา — ทุก Token ที่มี Scope read:purchasing จะเห็น Supplier ทั้งหมดของธุรกิจ

    Endpoint นี้เหมาะสำหรับ:

    • ซิงค์ข้อมูล Supplier เข้าสู่ระบบ ERP หรือ Accounting
    • อ้างอิง supplier_id สำหรับ filter ใน List Purchase Orders
    • สร้าง Supplier Directory ในระบบภายนอก

    Required Scope

    read:purchasing
    

    Access Token ต้องได้รับ Scope read:purchasing มิฉะนั้นระบบจะปฏิเสธคำขอ


    Endpoint

    GET /api/partner/v1/suppliers
    

    Request Headers

    Authorization: Bearer <access_token>
    

    Query Parameters

    ParameterTypeRequiredDescription
    statusstringNoกรองตามสถานะ: ACTIVE หรือ INACTIVE
    qstringNoค้นหาจาก company_name หรือ supplier_code (1–255 ตัวอักษร)
    limitintegerNoจำนวนรายการต่อหน้า (1–200) ค่าเริ่มต้น 50
    cursorstringNoCursor สำหรับดึงหน้าถัดไป

    Pagination

    Endpoint นี้ใช้ Cursor-based Pagination

    หาก has_more เป็น true ให้ส่ง next_cursor กลับมาใน parameter cursor

    GET /api/partner/v1/suppliers?cursor=<next_cursor>
    

    Example Request

    curl -X GET \
      "https://<host>/api/partner/v1/suppliers?status=ACTIVE&limit=50" \
      -H "Authorization: Bearer <access_token>"
    

    Example Response

    {
      "data": [
        {
          "id": "...",
          "supplier_code": "SUP-001",
          "company_name": "บริษัท ABC จำกัด",
          "contact_name": "คุณสมชาย",
          "phone_number": "02-000-0000",
          "email": "contact@abc.co.th",
          "tax_id": "0123456789012",
          "address": "123 ถนนสุขุมวิท",
          "city": "กรุงเทพมหานคร",
          "province": "กรุงเทพมหานคร",
          "postal_code": "10110",
          "country": "Thailand",
          "payment_terms": "Net 30",
          "status": "ACTIVE",
          "created_at": "2026-05-01T00:00:00.000Z",
          "updated_at": "2026-05-01T00:00:00.000Z"
        }
      ],
      "pagination": {
        "next_cursor": null,
        "has_more": false,
        "limit": 50
      }
    }
    

    Supplier Object

    FieldTypeDescription
    idstring (UUID)Supplier ID
    supplier_codestringรหัส Supplier
    company_namestringชื่อบริษัท / ร้านค้า
    contact_namestring | nullชื่อผู้ติดต่อ
    phone_numberstring | nullเบอร์โทรศัพท์
    emailstring | nullอีเมล
    tax_idstring | nullเลขประจำตัวผู้เสียภาษี
    addressstring | nullที่อยู่
    citystring | nullเมือง / เขต
    provincestring | nullจังหวัด
    postal_codestring | nullรหัสไปรษณีย์
    countrystring | nullประเทศ
    payment_termsstring | nullเงื่อนไขการชำระเงิน เช่น Net 30
    statusACTIVE | INACTIVEสถานะ Supplier
    created_atstring (ISO 8601)เวลาที่สร้าง record
    updated_atstring (ISO 8601)เวลาที่แก้ไขล่าสุด