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 Deliveries

    ดึงประวัติการส่ง Event (Delivery History) ของ Webhook Subscription หนึ่ง

    ทุกครั้งที่ MeeD พยายามส่ง Event ไปยัง Endpoint ของคุณ ระบบจะบันทึก Delivery record ไว้ — รวมถึงผลลัพธ์ที่ได้รับและจำนวนครั้งที่ Retry

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

    • ตรวจสอบว่า Event ถูกส่งสำเร็จหรือไม่
    • Debug Delivery ที่ล้มเหลว โดยดู response_status และ response_body
    • ติดตาม Delivery ที่อยู่ระหว่าง Retry (RETRYING)
    • ตรวจสอบ Event ที่ถึง DEAD เพื่อ Handle ด้วยตนเอง

    Required Scope

    read:webhooks
    

    Endpoint

    GET /api/partner/v1/webhooks/:id/deliveries
    

    Request Headers

    Authorization: Bearer <access_token>
    

    Path Parameters

    ParameterTypeRequiredDescription
    idstring (UUID)YesWebhook Subscription ID

    Query Parameters

    ParameterTypeRequiredDescription
    statusstringNoกรองตามสถานะ: PENDING, DELIVERED, RETRYING, DEAD
    event_typestringNoกรองตาม Event Type — ดูรายการได้ที่ Create Webhook
    limitintegerNoจำนวนรายการต่อหน้า (1–200) ค่าเริ่มต้น 50
    cursorstringNoCursor สำหรับดึงหน้าถัดไป

    Delivery Status

    StatusDescription
    PENDINGรอส่ง (ยังไม่ได้ attempt ครั้งแรก)
    DELIVEREDส่งสำเร็จ — Endpoint ตอบกลับ 2xx
    RETRYINGส่งล้มเหลว กำลัง Retry — ดูเวลา attempt ถัดไปที่ next_retry_at
    DEADRetry ครบ 5 ครั้งแล้วยังไม่สำเร็จ — ต้อง Handle Event ด้วยตนเอง

    ดู Retry schedule ที่ Payload & Signatures


    Pagination

    Endpoint นี้ใช้ Cursor-based Pagination

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

    GET /api/partner/v1/webhooks/:id/deliveries?cursor=<next_cursor>
    

    Example Request

    curl -X GET \
      "https://<host>/api/partner/v1/webhooks/a1b2c3d4-0000-0000-0000-000000000001/deliveries?status=DEAD&limit=50" \
      -H "Authorization: Bearer <access_token>"
    

    Example Response

    {
      "data": [
        {
          "id": "d1e2f3a4-0000-0000-0000-000000000001",
          "event_type": "sales.order.completed",
          "status": "DELIVERED",
          "attempt_count": 1,
          "response_status": 200,
          "response_body": "ok",
          "delivered_at": "2026-06-16T10:30:05.123Z",
          "next_retry_at": null,
          "created_at": "2026-06-16T10:30:00.000Z",
          "updated_at": "2026-06-16T10:30:05.123Z"
        }
      ],
      "pagination": {
        "next_cursor": null,
        "has_more": false,
        "limit": 50
      }
    }
    

    WebhookDelivery Object

    FieldTypeDescription
    idstring (UUID)Delivery ID
    event_typestringประเภท Event เช่น sales.order.completed
    statusstringสถานะการส่ง ดู Delivery Status ด้านบน
    attempt_countnumberจำนวนครั้งที่พยายามส่งแล้ว (รวม attempt ปัจจุบัน)
    response_statusnumber | nullHTTP Status ที่ได้รับจาก Endpoint — null หากเกิด Network Error หรือ Timeout
    response_bodystring | nullส่วนแรก 1,000 ตัวอักษรของ Response Body ที่ได้รับ
    delivered_atstring (ISO 8601) | nullเวลาที่ส่งสำเร็จ — null หากยังไม่ถึงสถานะ DELIVERED
    next_retry_atstring (ISO 8601) | nullเวลา Retry ถัดไป — null หากไม่อยู่ในสถานะ RETRYING
    created_atstring (ISO 8601)เวลาที่ Event ถูก Dispatch
    updated_atstring (ISO 8601)เวลาที่อัปเดตล่าสุด

    Error Responses

    Subscription Not Found

    404 Not Found
    
    {
      "error": "not_found",
      "message": "Webhook subscription not found"
    }
    

    สาเหตุ:

    • id ไม่ถูกต้อง
    • Subscription เป็นของ Application อื่น