Tài liệu API

Webhook

Stracker gọi vào endpoint https của bạn khi một chuyến được tạo, dời lịch, hủy, bắt đầu hoặc hoàn thành. Mỗi lệnh gọi được ký, được thử lại khi lỗi và lưu trong nhật ký gửi mà bạn đọc và gửi lại được.

Phần mô tả các thao tác và trường dưới đây được sinh tự động từ định nghĩa API nên giữ nguyên tiếng Anh ở mọi ngôn ngữ.

Tổng quan

  • Ứng dụng đăng ký bằng API (webhooks:manage, chỉ với token client_credentials); quản trị viên của đơn vị cũng có thể tạo subscription trong Stracker. Ứng dụng chỉ thấy và đổi các subscription do chính nó sở hữu, trong tenant của token.
  • Ứng dụng nhận các sự kiện trip.*, và chỉ khi có trips:read. Sự kiện thanh toán (invoice.*, payment.*, subscription.*, extension.*) chỉ gửi cho subscription của chính đơn vị, không bao giờ cho ứng dụng OAuth.
  • Gửi ít nhất một lần và không đảm bảo thứ tự. Loại trùng theo id của sự kiện.
  • Việc gửi cần đơn vị có tiện ích api.
  • Giới hạn: 10 subscription mỗi ứng dụng trong một tenant, 20 mỗi tenant, 30 loại sự kiện mỗi subscription. URL phải là https, cổng 443 or 8443 và phân giải ra địa chỉ công khai; được kiểm tra khi bạn lưu và ở mỗi lần kết nối.

Đăng ký

curl
curl -sS https://api.stracker.vn/v1/webhooks/subscriptions \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 0c2f9d3a-61a1-4f0e-8d2b-5a0c1e7f4b22" \
  -d '{
    "name": "Trips to my dispatch system",
    "url": "https://example.com/stracker/webhooks",
    "events": ["trip.created", "trip.rescheduled", "trip.cancelled", "trip.started", "trip.completed"]
  }'
  • Câu trả lời chứa subscription và khóa ký whsec_... của nó, một lần duy nhất. Hãy lưu ngay.
  • GET /v1/webhooks/event-types liệt kê các loại sự kiện người gọi được phép đăng ký. Xin loại khác là 403 WEBHOOK_EVENT_NOT_ALLOWED.
  • URL bị từ chối là 400 WEBHOOK_URL_NOT_ALLOWED kèm lý do (scheme, cổng, thông tin đăng nhập, fragment, không phân giải được, địa chỉ riêng).
  • Cập nhật bằng PATCH, tạm dừng bằng disable, bật lại bằng enable, xóa bằng DELETE: xem tham chiếu.

Một lần gửi trông thế nào

HTTP
POST /stracker/webhooks HTTP/1.1
Host: example.com
Content-Type: application/json
User-Agent: Stracker-Webhooks/1.0
Stracker-Event-Id: evt_01JD0000000000000000000000
Stracker-Event-Type: webhook.test
Stracker-Delivery-Id: 01JD00000000000000000000A1
Stracker-Delivery-Attempt: 1
Stracker-Webhook-Id: 42
Stracker-Signature: t=1763104324,v1=d351f50980e02348132b8097e68eeda996334f9c2b46b5fabbb8e26270e6bf9b

{"id":"evt_01JD0000000000000000000000","type":"webhook.test","createdAt":"2026-11-14T07:12:04.512Z","apiVersion":"2026-11-14","data":{"subscriptionId":42,"message":"Test event from Stracker"}}
HeaderMô tả
Stracker-Event-IdMã sự kiện, evt_ cộng một ULID. Giữ nguyên qua các lần thử lại và gửi lại: dùng để loại trùng.
Stracker-Event-TypeLoại sự kiện, ví dụ trip.completed.
Stracker-Delivery-IdĐịnh danh lần gửi này. Mỗi lần gửi một giá trị mới.
Stracker-Delivery-AttemptSố thứ tự lần gửi: 1 là lần đầu.
Stracker-Webhook-IdMã subscription mà lần gửi này thuộc về.
Stracker-Signaturet=<giây unix>,v1=<hex>, mỗi khóa ký còn hiệu lực có một v1. Xem xác minh chữ ký.
X-Stracker-SignatureChỉ với subscription cũ: sha256=<hex HMAC-SHA256 của nội dung thô>, không có mốc thời gian. Nên dùng Stracker-Signature.
  • Nội dung là phong bì JSON bên dưới, UTF-8, tối đa 64 KiB. Yêu cầu có Content-Type: application/json và User-Agent: Stracker-Webhooks/1.0.
  • Trả lời bất kỳ 2xx nào trong 10 giây. Mọi thứ khác là lần gửi thất bại, kể cả hết thời gian chờ và 3xx: không theo chuyển hướng.
  • Xác nhận nhanh rồi xử lý sau: đưa sự kiện vào hàng đợi của bạn.

Phong bì

TrườngMô tả
idevt_ cộng một ULID. Giữ nguyên qua các lần thử lại và gửi lại; dùng để loại trùng.
typeLoại sự kiện.
createdAtThời điểm sự kiện xảy ra, ISO 8601 theo UTC.
apiVersionNgày hình dạng payload được đổi lần cuối: 2026-11-14.
tenant{ "installId": "sti_..." } chỉ với subscription của ứng dụng đối tác; không có ở các trường hợp khác.
dataNội dung sự kiện. Các trường được liệt kê theo từng sự kiện bên dưới.
eventChỉ với subscription cũ: giống type.
occurredAtChỉ với subscription cũ: giống createdAt.
JSONMột lần gửi trip.completed (giá trị minh họa).
{
  "id": "evt_01JD...",
  "type": "trip.completed",
  "createdAt": "2026-11-14T07:12:04.512Z",
  "apiVersion": "2026-11-14",
  "tenant": { "installId": "sti_..." },
  "data": {
    "trip": {
      "id": 91,
      "code": "TR-2026-1114-004",
      "routeId": 4,
      "date": "2026-11-14",
      "status": "completed",
      "plannedStartTime": "07:00:00",
      "plannedEndTime": "07:45:00",
      "actualStartAt": "2026-11-14T00:02:10.000Z",
      "actualEndAt": "2026-11-14T00:47:31.000Z",
      "driverId": 3,
      "vehicleId": 7,
      "cancelReason": null
    }
  }
}

Thời điểm là ISO 8601 theo UTC. date của chuyến là ngày phục vụ theo giờ địa phương của đơn vị (YYYY-MM-DD) và giờ kế hoạch là giờ trong ngày (HH:mm:ss). data của từng sự kiện được liệt kê ở mục sự kiện.

Xác minh chữ ký

Ai cũng có thể gửi vào URL của bạn, nên hãy kiểm tra mọi yêu cầu đều đến từ Stracker. Header Stracker-Signature có dạng t=<giây unix>,v1=<hex>:

  1. Lấy nội dung yêu cầu thô đúng như nhận được. Đừng phân tích rồi tuần tự hóa lại: đổi một dấu cách là hỏng chữ ký.
  2. Đọc t và mọi v1 từ header. Khi đổi khóa bí mật có hai giá trị v1.
  3. Từ chối yêu cầu nếu |bây giờ - t| lớn hơn 300 giây. Điều này chặn việc phát lại yêu cầu cũ.
  4. Tính HMAC-SHA256(secret, t + "." + nội dung thô) và viết dưới dạng hex chữ thường.
  5. So sánh với từng v1 theo thời gian không đổi. Chấp nhận khi có một giá trị khớp.
Node.js
const crypto = require('node:crypto');

const TOLERANCE_SECONDS = 300;

/**
 * rawBody: the request body exactly as received (Buffer or string), never JSON.stringify(parsedBody).
 * header:  the value of the Stracker-Signature header.
 * secret:  the subscription's signing secret (whsec_...).
 */
function verifyStrackerSignature(rawBody, header, secret, nowSeconds = Math.floor(Date.now() / 1000)) {
  let timestamp = null;
  const candidates = [];
  for (const part of String(header ?? '').split(',')) {
    const at = part.indexOf('=');
    if (at < 0) continue;
    const key = part.slice(0, at).trim();
    const value = part.slice(at + 1).trim();
    if (key === 't' && /^\d+$/.test(value)) timestamp = Number(value);
    if (key === 'v1' && /^[0-9a-f]+$/.test(value)) candidates.push(value); // one per live secret
  }
  if (timestamp === null || candidates.length === 0) return false;
  if (Math.abs(nowSeconds - timestamp) > TOLERANCE_SECONDS) return false; // replay protection

  const body = Buffer.isBuffer(rawBody) ? rawBody : Buffer.from(rawBody, 'utf8');
  const expected = crypto.createHmac('sha256', secret).update(`${timestamp}.`).update(body).digest();
  return candidates.some((candidate) => {
    const given = Buffer.from(candidate, 'hex');
    return given.length === expected.length && crypto.timingSafeEqual(given, expected);
  });
}
Python
import hashlib
import hmac
import time

TOLERANCE_SECONDS = 300


def verify_stracker_signature(raw_body: bytes, header: str, secret: str, now: float | None = None) -> bool:
    """raw_body: the request body exactly as received (bytes), never json.dumps(parsed_body)."""
    timestamp = None
    candidates = []
    for part in (header or "").split(","):
        key, sep, value = part.strip().partition("=")
        if not sep:
            continue
        if key == "t" and value.isdigit():
            timestamp = int(value)
        elif key == "v1" and value:
            candidates.append(value)  # one per live secret during a rotation
    if timestamp is None or not candidates:
        return False
    if abs((time.time() if now is None else now) - timestamp) > TOLERANCE_SECONDS:
        return False  # replay protection

    expected = hmac.new(
        secret.encode("utf-8"), str(timestamp).encode("ascii") + b"." + raw_body, hashlib.sha256
    ).hexdigest()
    return any(hmac.compare_digest(candidate, expected) for candidate in candidates)
PHP
<?php

const STRACKER_TOLERANCE_SECONDS = 300;

/**
 * $rawBody: the request body exactly as received (file_get_contents('php://input')),
 * never json_encode(json_decode($body)).
 */
function verifyStrackerSignature(string $rawBody, string $header, string $secret, ?int $now = null): bool
{
    $timestamp = null;
    $candidates = [];
    foreach (explode(',', $header) as $part) {
        $pair = explode('=', trim($part), 2);
        if (count($pair) !== 2) {
            continue;
        }
        [$key, $value] = $pair;
        if ($key === 't' && ctype_digit($value)) {
            $timestamp = (int) $value;
        } elseif ($key === 'v1' && $value !== '') {
            $candidates[] = $value; // one per live secret during a rotation
        }
    }
    if ($timestamp === null || $candidates === []) {
        return false;
    }
    if (abs(($now ?? time()) - $timestamp) > STRACKER_TOLERANCE_SECONDS) {
        return false; // replay protection
    }

    $expected = hash_hmac('sha256', $timestamp . '.' . $rawBody, $secret);
    foreach ($candidates as $candidate) {
        if (hash_equals($expected, $candidate)) {
            return true;
        }
    }
    return false;
}

Nối vào trình xử lý của bạn. Mỗi ví dụ đọc byte thô, xác minh rồi xác nhận:

Node.js (Express)
const express = require('express');
const app = express();

// Keep the raw bytes: the signature covers them, not the parsed JSON.
app.post('/stracker/webhooks', express.raw({ type: 'application/json', limit: '128kb' }), (req, res) => {
  const ok = verifyStrackerSignature(req.body, req.get('Stracker-Signature'), process.env.STRACKER_WEBHOOK_SECRET);
  if (!ok) return res.status(400).send('invalid signature');

  const event = JSON.parse(req.body.toString('utf8'));
  // Dedupe on event.id (deliveries are at least once), then do the work out of band.
  // queue.add({ id: event.id, type: event.type, data: event.data });
  res.status(204).end(); // answer 2xx within 10 seconds
});

app.listen(3000);
Python (Flask)
import json
import os

from flask import Flask, request

app = Flask(__name__)


@app.post("/stracker/webhooks")
def stracker_webhook():
    raw = request.get_data()  # the raw bytes, not request.get_json()
    header = request.headers.get("Stracker-Signature", "")
    if not verify_stracker_signature(raw, header, os.environ["STRACKER_WEBHOOK_SECRET"]):
        return "invalid signature", 400

    event = json.loads(raw)
    # Dedupe on event["id"] (deliveries are at least once), then do the work out of band.
    return "", 204  # answer 2xx within 10 seconds
PHP
<?php

$rawBody = file_get_contents('php://input');
$header = $_SERVER['HTTP_STRACKER_SIGNATURE'] ?? '';

if (!verifyStrackerSignature($rawBody, $header, getenv('STRACKER_WEBHOOK_SECRET'))) {
    http_response_code(400);
    exit('invalid signature');
}

$event = json_decode($rawBody, true);
// Dedupe on $event['id'] (deliveries are at least once), then do the work out of band.
http_response_code(204); // answer 2xx within 10 seconds

Bộ dữ liệu thử để kiểm tra mã của bạn

Mã của bạn phải ra đúng v1 này. Giá trị được tính bằng một bản cài đặt HMAC độc lập và được các bài kiểm thử đơn vị của Stracker cố định lại; các ví dụ ở trên đã được kiểm thử với nó.

Test vector
secret    whsec_test_vector_secret
t         1763104324
body      {"id":"evt_01JD0000000000000000000000","type":"webhook.test","createdAt":"2026-11-14T07:12:04.512Z","apiVersion":"2026-11-14","data":{"subscriptionId":42,"message":"Test event from Stracker"}}

signed    "1763104324." + body
v1        d351f50980e02348132b8097e68eeda996334f9c2b46b5fabbb8e26270e6bf9b
header    t=1763104324,v1=d351f50980e02348132b8097e68eeda996334f9c2b46b5fabbb8e26270e6bf9b

Thử lại

Một lần gửi thất bại khi trả lời không phải 2xx, hết thời gian chờ hoặc lỗi mạng. Stracker khi đó thử lại theo lịch dưới đây, mỗi quãng chờ lệch tới ±10 % để endpoint đang hồi phục không bị dồn dập. Một thông điệp có 7 lần gửi trong khoảng 32 giờ 36 phút; sau lần cuối nó bị đánh dấu failed.

Lần gửiChờ trước lần nàyTừ lần gửi đầu
1ngay lập tức0
21 phút1 phút
35 phút6 phút
430 phút36 phút
52 giờ156 phút
66 giờ516 phút
71 ngày1956 phút

Tự động tắt

Sau 25 lần gửi thất bại liên tiếp, tính qua các thông điệp, và chuỗi thất bại kéo dài ít nhất 24 giờ, Stracker tắt subscription (disabledReason: "auto_failures") và gửi email cho những người dùng quản lý webhook trong tenant. Một loạt lỗi trong vòng một ngày không bao giờ làm nó bị tắt. Hãy sửa endpoint rồi POST /v1/webhooks/subscriptions/{id}/enable: URL được kiểm tra lại và bộ đếm được đặt lại. Các thông điệp đang chờ lúc bị tắt bị hủy, và sự kiện xảy ra khi đang tắt sẽ không được gửi bù: hãy đối soát bằng GET /v1/trips.

Nhật ký gửi và gửi lại

  • GET /v1/webhooks/messages liệt kê thông điệp (pending, delivered, failed, cancelled); GET /v1/webhooks/messages/{id} thêm từng lần gửi với nhóm trạng thái, độ trễ, đoạn trích ngắn của phản hồi và payload chính xác.
  • POST /v1/webhooks/messages/{id}/redeliver xếp thêm một lần gửi ngay, với cùng id sự kiện. Thông điệp quá cũ là 410 WEBHOOK_MESSAGE_EXPIRED.
  • Thông điệp được giữ 30 ngày và các lần gửi được giữ 90 ngày.
curl
# Find the message, then queue one more attempt now
curl -sS "https://api.stracker.vn/v1/webhooks/messages?status=failed" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
curl -sS -X POST https://api.stracker.vn/v1/webhooks/messages/$MESSAGE_ID/redeliver \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Đổi khóa bí mật

POST /v1/webhooks/subscriptions/{id}/rotate-secret trả về khóa mới, một lần. Trong 24 giờ mọi lần gửi được ký bằng cả hai khóa (hai giá trị v1), nên bạn chuyển đổi không bị gián đoạn. Gửi { "revokePreviousNow": true } để bỏ khóa cũ ngay. Phát lại cùng yêu cầu với Idempotency-Key không trả khóa bí mật.

Sự kiện thử

POST /v1/webhooks/subscriptions/{id}/test gửi một sự kiện webhook.test có chữ ký và trả về việc có gửi được không, mã trạng thái và độ trễ. Giới hạn 10 lần mỗi phút cho mỗi subscription.

curl
# Send a webhook.test event to the endpoint and read the outcome
curl -sS -X POST https://api.stracker.vn/v1/webhooks/subscriptions/$SUBSCRIPTION_ID/test \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Giới hạn có chủ đích

  • Không có trip.created cho chuyến tạo hàng loạt hoặc do Stracker sinh ra: chỉ chuyến đơn tạo qua đường tạo chuyến mới phát sự kiện này. Không có sự kiện cho việc xóa chuyến hay phân tài xế.
  • Một sự kiện có thể mất nếu tiến trình Stracker dừng giữa lúc lưu thay đổi và lúc phát sự kiện; việc phát không bao giờ chặn hay hoàn tác thay đổi chuyến. Thỉnh thoảng hãy đối soát bằng GET /v1/trips.
  • Không bảo đảm thứ tự. Hãy dùng dữ liệu chuyến trong sự kiện, hoặc tải lại chuyến, thay vì dựa vào thứ tự đến.

Sự kiện

trip.created Chuyến được tạo

  • Gửi tới Subscription của chính đơn vị và các ứng dụng có scope bên dưới
  • Scope trips:read

Các trường của data

TrườngKiểuMô tả
tripbắt buộcobject
trip.idbắt buộcinteger
trip.codebắt buộcstring | nullcó thể null
trip.routeIdbắt buộcinteger
trip.datebắt buộcstringpattern ^\d{4}-\d{2}-\d{2}$
trip.statusbắt buộcstringGiá trị: scheduledin_progresscompletedcancelled
trip.plannedStartTimebắt buộcstring | nullcó thể null
trip.plannedEndTimebắt buộcstring | nullcó thể null
trip.actualStartAtbắt buộcstring | nullcó thể null
trip.actualEndAtbắt buộcstring | nullcó thể null
trip.driverIdbắt buộcinteger | nullcó thể null
trip.vehicleIdbắt buộcinteger | nullcó thể null
trip.cancelReasonnull
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "trip": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "code": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 60
            },
            {
              "type": "null"
            }
          ]
        },
        "routeId": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "in_progress",
            "completed",
            "cancelled"
          ]
        },
        "plannedStartTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "plannedEndTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "actualStartAt": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "actualEndAt": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "driverId": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "vehicleId": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "cancelReason": {
          "type": "null"
        }
      },
      "required": [
        "id",
        "code",
        "routeId",
        "date",
        "status",
        "plannedStartTime",
        "plannedEndTime",
        "actualStartAt",
        "actualEndAt",
        "driverId",
        "vehicleId"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "trip"
  ],
  "additionalProperties": false
}

trip.rescheduled Chuyến được dời giờ

  • Gửi tới Subscription của chính đơn vị và các ứng dụng có scope bên dưới
  • Scope trips:read

Các trường của data

TrườngKiểuMô tả
tripbắt buộcobject
trip.idbắt buộcinteger
trip.codebắt buộcstring | nullcó thể null
trip.routeIdbắt buộcinteger
trip.datebắt buộcstringpattern ^\d{4}-\d{2}-\d{2}$
trip.statusbắt buộcstringGiá trị: scheduledin_progresscompletedcancelled
trip.plannedStartTimebắt buộcstring | nullcó thể null
trip.plannedEndTimebắt buộcstring | nullcó thể null
trip.actualStartAtbắt buộcstring | nullcó thể null
trip.actualEndAtbắt buộcstring | nullcó thể null
trip.driverIdbắt buộcinteger | nullcó thể null
trip.vehicleIdbắt buộcinteger | nullcó thể null
trip.previousPlannedStartTimebắt buộcstring | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "trip": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "code": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 60
            },
            {
              "type": "null"
            }
          ]
        },
        "routeId": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "in_progress",
            "completed",
            "cancelled"
          ]
        },
        "plannedStartTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "plannedEndTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "actualStartAt": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "actualEndAt": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "driverId": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "vehicleId": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "previousPlannedStartTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "code",
        "routeId",
        "date",
        "status",
        "plannedStartTime",
        "plannedEndTime",
        "actualStartAt",
        "actualEndAt",
        "driverId",
        "vehicleId",
        "previousPlannedStartTime"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "trip"
  ],
  "additionalProperties": false
}

trip.cancelled Chuyến bị hủy

  • Gửi tới Subscription của chính đơn vị và các ứng dụng có scope bên dưới
  • Scope trips:read

Các trường của data

TrườngKiểuMô tả
tripbắt buộcobject
trip.idbắt buộcinteger
trip.codebắt buộcstring | nullcó thể null
trip.routeIdbắt buộcinteger
trip.datebắt buộcstringpattern ^\d{4}-\d{2}-\d{2}$
trip.statusbắt buộcstringGiá trị: scheduledin_progresscompletedcancelled
trip.plannedStartTimebắt buộcstring | nullcó thể null
trip.plannedEndTimebắt buộcstring | nullcó thể null
trip.actualStartAtbắt buộcstring | nullcó thể null
trip.actualEndAtbắt buộcstring | nullcó thể null
trip.driverIdbắt buộcinteger | nullcó thể null
trip.vehicleIdbắt buộcinteger | nullcó thể null
trip.cancelReasonbắt buộcstring | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "trip": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "code": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 60
            },
            {
              "type": "null"
            }
          ]
        },
        "routeId": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "in_progress",
            "completed",
            "cancelled"
          ]
        },
        "plannedStartTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "plannedEndTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "actualStartAt": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "actualEndAt": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "driverId": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "vehicleId": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "cancelReason": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 500
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "code",
        "routeId",
        "date",
        "status",
        "plannedStartTime",
        "plannedEndTime",
        "actualStartAt",
        "actualEndAt",
        "driverId",
        "vehicleId",
        "cancelReason"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "trip"
  ],
  "additionalProperties": false
}

trip.started Chuyến bắt đầu

  • Gửi tới Subscription của chính đơn vị và các ứng dụng có scope bên dưới
  • Scope trips:read

Các trường của data

TrườngKiểuMô tả
tripbắt buộcobject
trip.idbắt buộcinteger
trip.codebắt buộcstring | nullcó thể null
trip.routeIdbắt buộcinteger
trip.datebắt buộcstringpattern ^\d{4}-\d{2}-\d{2}$
trip.statusbắt buộcstringGiá trị: scheduledin_progresscompletedcancelled
trip.plannedStartTimebắt buộcstring | nullcó thể null
trip.plannedEndTimebắt buộcstring | nullcó thể null
trip.actualStartAtbắt buộcstring | nullcó thể null
trip.actualEndAtbắt buộcstring | nullcó thể null
trip.driverIdbắt buộcinteger | nullcó thể null
trip.vehicleIdbắt buộcinteger | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "trip": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "code": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 60
            },
            {
              "type": "null"
            }
          ]
        },
        "routeId": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "in_progress",
            "completed",
            "cancelled"
          ]
        },
        "plannedStartTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "plannedEndTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "actualStartAt": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "actualEndAt": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "driverId": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "vehicleId": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "code",
        "routeId",
        "date",
        "status",
        "plannedStartTime",
        "plannedEndTime",
        "actualStartAt",
        "actualEndAt",
        "driverId",
        "vehicleId"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "trip"
  ],
  "additionalProperties": false
}

trip.completed Chuyến hoàn thành

  • Gửi tới Subscription của chính đơn vị và các ứng dụng có scope bên dưới
  • Scope trips:read

Các trường của data

TrườngKiểuMô tả
tripbắt buộcobject
trip.idbắt buộcinteger
trip.codebắt buộcstring | nullcó thể null
trip.routeIdbắt buộcinteger
trip.datebắt buộcstringpattern ^\d{4}-\d{2}-\d{2}$
trip.statusbắt buộcstringGiá trị: scheduledin_progresscompletedcancelled
trip.plannedStartTimebắt buộcstring | nullcó thể null
trip.plannedEndTimebắt buộcstring | nullcó thể null
trip.actualStartAtbắt buộcstring | nullcó thể null
trip.actualEndAtbắt buộcstring | nullcó thể null
trip.driverIdbắt buộcinteger | nullcó thể null
trip.vehicleIdbắt buộcinteger | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "trip": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "code": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 60
            },
            {
              "type": "null"
            }
          ]
        },
        "routeId": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "in_progress",
            "completed",
            "cancelled"
          ]
        },
        "plannedStartTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "plannedEndTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}(:\\d{2})?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "actualStartAt": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "actualEndAt": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "driverId": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "vehicleId": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "code",
        "routeId",
        "date",
        "status",
        "plannedStartTime",
        "plannedEndTime",
        "actualStartAt",
        "actualEndAt",
        "driverId",
        "vehicleId"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "trip"
  ],
  "additionalProperties": false
}

invoice.created Hoá đơn được tạo

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
invoiceIdbắt buộcnumber | string
clientIdnumber | string | nullcó thể null
totalAmountnumber | string | nullcó thể null
amountnumber | string | nullcó thể null
paymentIdnumber | string | nullcó thể null
pspRefundIdstring | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "invoiceId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "clientId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "totalAmount": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "amount": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "paymentId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "pspRefundId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "invoiceId"
  ],
  "additionalProperties": {}
}

invoice.paid Hoá đơn đã thanh toán

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
invoiceIdbắt buộcnumber | string
clientIdnumber | string | nullcó thể null
totalAmountnumber | string | nullcó thể null
amountnumber | string | nullcó thể null
paymentIdnumber | string | nullcó thể null
pspRefundIdstring | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "invoiceId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "clientId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "totalAmount": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "amount": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "paymentId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "pspRefundId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "invoiceId"
  ],
  "additionalProperties": {}
}

invoice.payment_failed Thanh toán hoá đơn thất bại

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
invoiceIdbắt buộcnumber | string
clientIdnumber | string | nullcó thể null
totalAmountnumber | string | nullcó thể null
amountnumber | string | nullcó thể null
paymentIdnumber | string | nullcó thể null
pspRefundIdstring | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "invoiceId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "clientId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "totalAmount": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "amount": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "paymentId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "pspRefundId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "invoiceId"
  ],
  "additionalProperties": {}
}

invoice.refunded Hoá đơn được hoàn tiền

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
invoiceIdbắt buộcnumber | string
clientIdnumber | string | nullcó thể null
totalAmountnumber | string | nullcó thể null
amountnumber | string | nullcó thể null
paymentIdnumber | string | nullcó thể null
pspRefundIdstring | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "invoiceId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "clientId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "totalAmount": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "amount": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "paymentId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "pspRefundId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "invoiceId"
  ],
  "additionalProperties": {}
}

payment.completed Thanh toán hoàn tất

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
invoiceIdbắt buộcnumber | string
clientIdnumber | string | nullcó thể null
paymentIdbắt buộcnumber | string
succeededboolean | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "invoiceId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "clientId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "paymentId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "succeeded": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "invoiceId",
    "paymentId"
  ],
  "additionalProperties": {}
}

payment.failed Thanh toán thất bại

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
invoiceIdbắt buộcnumber | string
clientIdnumber | string | nullcó thể null
paymentIdbắt buộcnumber | string
succeededboolean | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "invoiceId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "clientId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "paymentId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "succeeded": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "invoiceId",
    "paymentId"
  ],
  "additionalProperties": {}
}

subscription.created Gói dịch vụ được tạo

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
subscriptionIdbắt buộcnumber | string
clientIdnumber | string | nullcó thể null
planIdnumber | string | nullcó thể null
planVersionIdnumber | string | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "subscriptionId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "clientId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "planId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "planVersionId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "subscriptionId"
  ],
  "additionalProperties": {}
}

subscription.upgraded Gói dịch vụ được nâng cấp

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
subscriptionIdbắt buộcnumber | string
clientIdnumber | string | nullcó thể null
planIdnumber | string | nullcó thể null
planVersionIdnumber | string | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "subscriptionId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "clientId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "planId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "planVersionId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "subscriptionId"
  ],
  "additionalProperties": {}
}

subscription.canceled Gói dịch vụ bị hủy

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
subscriptionIdbắt buộcnumber | string
clientIdnumber | string | nullcó thể null
planIdnumber | string | nullcó thể null
planVersionIdnumber | string | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "subscriptionId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "clientId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "planId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "planVersionId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "subscriptionId"
  ],
  "additionalProperties": {}
}

extension.installed Tiện ích được cài

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
clientIdbắt buộcnumber | string
extensionIdbắt buộcnumber | string
installedVersionIdnumber | string | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "clientId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "extensionId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "installedVersionId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "clientId",
    "extensionId"
  ],
  "additionalProperties": {}
}

extension.upgraded Tiện ích được nâng cấp

  • Gửi tới Chỉ subscription của chính đơn vị, không bao giờ gửi tới ứng dụng OAuth

Các trường của data

TrườngKiểuMô tả
clientIdbắt buộcnumber | string
extensionIdbắt buộcnumber | string
installedVersionIdnumber | string | nullcó thể null
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "clientId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "extensionId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "installedVersionId": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "clientId",
    "extensionId"
  ],
  "additionalProperties": {}
}

webhook.test Sự kiện thử

  • Gửi tới Subscription được gửi thử

Các trường của data

TrườngKiểuMô tả
subscriptionIdbắt buộcnumber | string
messagebắt buộcstring
JSON Schema của data
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "subscriptionId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "subscriptionId",
    "message"
  ],
  "additionalProperties": false
}