Chann1 CRM AIAPI กลับหน้าหลักBack to home
Chann1 API · v1

เชื่อม Chann1 กับระบบบัญชีหรือ ERP ของร้านConnect Chann1 to your accounting or ERP system

อ่านและเขียนข้อมูลลูกค้า ดีล ใบเสนอราคา ใบแจ้งหนี้และรับชำระ งานซ่อม ประกัน และสินค้า ผ่าน REST API แบบ JSON ด้วย API key ของร้าน ทุกการเปลี่ยนแปลงผ่าน API ถูกบันทึกในประวัติการใช้งานของร้านRead and write customers, deals, quotes, invoices and payments, service tickets, warranties and products through a JSON REST API, using your shop's API key. Every change made through the API is recorded in your shop's activity history.

ใช้ได้ในแพ็กเกจ Enterprise ขึ้นไปAvailable on Enterprise and above
Base path
/api/ext/v1
ยืนยันตัวตนAuth
Authorization: Bearer chann_live_…
รูปแบบFormat
JSON · UTF-8
โควตาRate limit
600 request / นาที / key600 requests / minute / key
Endpoints
29 รายการ ใน 8 กลุ่ม29 in 8 groups

เริ่มใช้งานGetting started

  1. สร้าง API keyCreate an API key

    เจ้าของร้านเปิด Dashboard › จัดการร้าน › API แล้วกด "สร้าง key" ตั้งชื่อตามระบบที่จะเชื่อม เช่น ระบบบัญชี key จะแสดงเต็มแค่ครั้งเดียว ให้คัดลอกเก็บไว้ทันทีThe shop owner opens Dashboard › Manage shop › API and creates a key named after the system it's for, such as Accounting. The full key is shown only once, so copy it right away.

  2. ทดสอบด้วย /meTest with /me

    เรียก GET /me พร้อม key ใน header ถ้าได้ชื่อร้านกลับมา แปลว่าเชื่อมต่อสำเร็จCall GET /me with the key in the header. If your shop's name comes back, you're connected.

  3. ซิงก์เฉพาะที่เปลี่ยนSync only what changed

    ครั้งถัดไปส่ง updated_since เป็นเวลาที่ซิงก์ครั้งก่อน จะได้เฉพาะรายการที่แก้หลังจากนั้นOn later runs, pass updated_since with your last sync time to get only records changed since then.

# API host ของคุณจะแจ้งพร้อมเปิดใช้ APIYour API host is provided when API access is enabled
curl https://<api-host>/api/ext/v1/me \
  -H "Authorization: Bearer chann_live_…"

ยืนยันตัวตนและข้อผิดพลาดAuthentication & errors

  • ส่ง key ทุกครั้งใน header Authorization: Bearer <key> key ขึ้นต้นด้วย chann_live_Send the key on every request as Authorization: Bearer <key>. Keys start with chann_live_.
  • key หนึ่งตัวผูกกับร้านเดียว และเข้าถึงได้เฉพาะ 8 กลุ่มข้อมูลในหน้านี้ ไม่มีการจัดการสมาชิก บทบาท หรือการตั้งค่าร้านผ่าน APIEach key belongs to one shop and reaches only the 8 resource groups on this page. Members, roles and shop settings are not available through the API.
  • เพิกถอน key ได้ทุกเมื่อจากหน้า API หรือพิมพ์ในแชท LINE ของร้าน การเรียกด้วย key ที่เพิกถอนแล้วจะได้ 401 ทันทีRevoke a key any time from the API page or in your shop's LINE chat. Calls with a revoked key get 401 immediately.
  • ในประวัติการใช้งานของร้าน ผู้ทำรายการผ่าน API จะแสดงเป็น api:<key id> จึงแยกได้ว่ารายการไหนมาจากระบบภายนอกIn the shop's activity history, API changes show the actor as api:<key id>, so you can tell which records came from outside systems.
HTTPerror.codeความหมายMeaning
401missing_or_malformed_keyไม่ได้ส่ง header หรือรูปแบบไม่ถูกต้องThe header is missing or malformed
401unknown_or_revoked_keyไม่พบ key หรือ key ถูกเพิกถอนแล้วThe key doesn't exist or was revoked
422—ข้อมูลที่ส่งไม่ครบหรือไม่ถูกต้อง ข้อความจะบอกว่าขาดอะไร เช่น ออกใบแจ้งหนี้จากดีลที่ยังไม่มีสินค้าThe request data is missing or invalid; the message says what's missing, e.g. invoicing a deal with no line items
429—เกินโควตา 600 request ต่อนาที รอตามเวลาใน header Retry-After แล้วค่อยเรียกใหม่Over 600 requests per minute; wait for the Retry-After header before retrying
# ทุกข้อผิดพลาดใช้รูปแบบเดียวกันEvery error has the same shape
{ "error": { "code": "unknown_or_revoked_key", "message": "…" } }

รายการและการซิงก์Lists & incremental sync

  • ทุก endpoint แบบรายการรับ limit (1–200 ค่าเริ่มต้น 50) และ offset (ค่าเริ่มต้น 0)Every list endpoint takes limit (1–200, default 50) and offset (default 0).
  • ผลลัพธ์มี items, total, limit, offset และ header X-Total-CountResponses include items, total, limit, offset and an X-Total-Count header.
  • updated_since (ISO-8601) ใช้ได้กับ customers, deals, invoices และ tickets คืนเฉพาะรายการที่แก้หลังเวลานั้นupdated_since (ISO-8601) works on customers, deals, invoices and tickets and returns only records changed after that time.
  • ลูกค้าที่ร้านรวมเข้ากับอีกรายแล้วจะไม่อยู่ในรายการ ส่วน GET /customers/{id} ของรายนั้นยังตอบ 200 พร้อม merged_into_id และ merged_into (id, customer_id, name) ใช้ย้ายข้อมูลฝั่งคุณไปหารายหลักA customer the shop has merged into another one is left out of lists. GET /customers/{id} for it still returns 200 with merged_into_id and merged_into (id, customer_id, name), so you can re-key your records to the surviving customer.
curl "https://<api-host>/api/ext/v1/customers?updated_since=2026-09-01T00:00:00%2B07:00&limit=100" \
  -H "Authorization: Bearer chann_live_…"

{ "items": [ … ], "total": 128, "limit": 100, "offset": 0 }

ตัวอย่าง: ออกใบแจ้งหนี้และบันทึกรับชำระExample: issue an invoice and record payment

ออกใบแจ้งหนี้จากดีลที่มีสินค้าแล้ว ขอลิงก์ PDF แล้วบันทึกว่ารับชำระเต็มยอด ใบแจ้งหนี้จะเปลี่ยนเป็นชำระแล้ว และเห็นตรงกันใน DashboardInvoice a deal that has line items, get the PDF link, then record full payment. The invoice becomes paid and shows the same in the Dashboard.

# 1 · ออกใบแจ้งหนี้และ PDF ทันทีCreate the invoice and issue its PDF
POST /api/ext/v1/invoices
{ "deal_id": "<deal id>", "issue": true }

# 2 · ขอลิงก์ PDFGet the PDF link
GET /api/ext/v1/invoices/<invoice id>/pdf

# 3 · บันทึกรับชำระเต็มยอดRecord full payment
POST /api/ext/v1/invoices/<invoice id>/payments
{ "full": true, "method": "transfer" }

Endpoints

path ทั้งหมดต่อท้าย /api/ext/v1 · สร้างใหม่ตอบ 201 · ข้อมูลไม่ถูกต้องตอบ 422All paths are relative to /api/ext/v1 · creates return 201 · invalid input returns 422

ร้านและ key นี้Your shop and key me

  • GET/meร้านและ key นี้Who am I

ลูกค้าCustomers customers

  • GET/customersรายชื่อลูกค้าList customers
    พารามิเตอร์Parameters

    Query

    q
    string
    stage
    string
    updated_since
    ISO-8601 datetime
    limit
    integer 1–200 · default 50
    offset
    integer · default 0
  • POST/customersเพิ่มลูกค้าCreate a customer
    พารามิเตอร์Parameters

    Body · JSON

    first_nameจำเป็นrequired
    string
    last_name
    string
    phone
    string
    email
    string
    address
    string
    notes
    string
    stage
    lead | contact · default contact
  • GET/customers/{customer_id}ลูกค้าหนึ่งรายOne customer
  • PATCH/customers/{customer_id}แก้ไขลูกค้าUpdate a customer
    พารามิเตอร์Parameters

    Body · JSON

    first_name
    string
    last_name
    string
    phone
    string
    email
    string
    address
    string
    notes
    string

ดีลDeals deals

  • GET/dealsรายการดีลList deals
    พารามิเตอร์Parameters

    Query

    q
    string
    stage
    string
    updated_since
    ISO-8601 datetime
    limit
    integer 1–200 · default 50
    offset
    integer · default 0
  • POST/dealsสร้างดีลCreate a deal
    พารามิเตอร์Parameters

    Body · JSON

    customer_idจำเป็นrequired
    string
    amount
    number
    currency
    string
    expected_close_date
    date
    notes
    string
  • GET/deals/{deal_id}ดีลพร้อมรายการสินค้าOne deal with its lines
  • PATCH/deals/{deal_id}แก้ไขดีลUpdate a deal
    พารามิเตอร์Parameters

    Body · JSON

    amount
    number
    currency
    string
    expected_close_date
    date
    notes
    string
  • POST/deals/{deal_id}/stageย้ายสถานะดีลMove a deal's stage
    พารามิเตอร์Parameters

    Body · JSON

    stageจำเป็นrequired
    new | proposed | won | lost
    lost_reason
    string

ใบเสนอราคาQuotes quotes

  • GET/quotesรายการใบเสนอราคาList quotes
    พารามิเตอร์Parameters

    Query

    deal_id
    string
    status
    string
    q
    string
    limit
    integer 1–200 · default 50
    offset
    integer · default 0
  • GET/quotes/{quote_id}ใบเสนอราคาพร้อมรายการOne quote with its lines
  • GET/quotes/{quote_id}/pdfลิงก์ PDF ใบเสนอราคาQuote PDF link

ใบแจ้งหนี้และรับชำระInvoices & payments invoices

  • GET/invoicesรายการใบแจ้งหนี้List invoices
    พารามิเตอร์Parameters

    Query

    status
    string
    deal_id
    string
    quote_id
    string
    overdue
    boolean · default false
    updated_since
    ISO-8601 datetime
    limit
    integer 1–200 · default 50
    offset
    integer · default 0
  • POST/invoicesออกใบแจ้งหนี้จากดีลหรือใบเสนอราคาCreate an invoice from a deal or quote
    พารามิเตอร์Parameters

    Body · JSON

    deal_id
    string
    quote_id
    string
    note
    string
    issue
    boolean · true = issue the PDF now (draft → issued)
  • GET/invoices/{invoice_id}ใบแจ้งหนี้พร้อมการชำระOne invoice with payments
  • POST/invoices/{invoice_id}/paymentsบันทึกรับชำระRecord a payment
    พารามิเตอร์Parameters

    Body · JSON

    amount
    number
    full
    boolean · default false
    method
    cash | transfer | card | other
    reference
    string
    note
    string
    paid_at
    ISO-8601 datetime
  • GET/invoices/{invoice_id}/pdfลิงก์ PDF ใบแจ้งหนี้Invoice PDF link
  • GET/invoices/{invoice_id}/receipt-pdfลิงก์ PDF ใบเสร็จReceipt PDF link

งานซ่อมService tickets tickets

  • GET/ticketsรายการงานซ่อมList tickets
    พารามิเตอร์Parameters

    Query

    status
    string
    customer_id
    string
    q
    string
    updated_since
    ISO-8601 datetime
    limit
    integer 1–200 · default 50
    offset
    integer · default 0
  • POST/ticketsแจ้งงานซ่อมLog a ticket
    พารามิเตอร์Parameters

    Body · JSON

    problemจำเป็นrequired
    string
    customer_id
    string
    address
    string
    appointment_at
    ISO-8601 datetime
  • GET/tickets/{ticket_id}งานซ่อมหนึ่งรายการOne ticket

ทะเบียนสินค้าและประกันWarranties warranties

  • GET/warrantiesรายการประกันList warranties
    พารามิเตอร์Parameters

    Query

    q
    string
    status
    string
    limit
    integer 1–200 · default 50
    offset
    integer · default 0
  • POST/warrantiesลงทะเบียนประกันRegister a warranty
    พารามิเตอร์Parameters

    Body · JSON

    serial_numberจำเป็นrequired
    string
    product_id
    string
    customer_id
    string
    purchase_date
    date
    warranty_months
    integer
  • GET/warranties/{warranty_id}ประกันหนึ่งรายการOne warranty

สินค้าProducts products

  • GET/productsรายการสินค้าList products
    พารามิเตอร์Parameters

    Query

    q
    string
    category
    string
    include_archived
    boolean · default false
    limit
    integer 1–200 · default 50
    offset
    integer · default 0
  • POST/productsเพิ่มสินค้าCreate a product
    พารามิเตอร์Parameters

    Body · JSON

    nameจำเป็นrequired
    string
    product_id
    string
    sku
    string
    category
    string
    unit_price
    number
    description
    string
    warranty_months
    integer
  • GET/products/{product_id}สินค้าหนึ่งรายการOne product
  • PATCH/products/{product_id}แก้ไขสินค้าUpdate a product
    พารามิเตอร์Parameters

    Body · JSON

    name
    string
    sku
    string
    category
    string
    unit_price
    number
    description
    string
    warranty_months
    integer

อยากเชื่อมระบบของร้านกับ Chann1?Want to connect your systems to Chann1?

API เปิดใช้ในแพ็กเกจ Enterprise ขึ้นไป ทีมงานช่วยวางแผนการเชื่อมต่อให้ได้API access comes with Enterprise and above. Our team can help you plan the integration.