AM
TH
เริ่มต้นฟรี
เมนู
ประเภท

Payment

ระเบียนธุรกรรมทางการเงินสำหรับติดตามการชำระเงินภายในบัญชี

payments transactions billing

Payment

Payment บันทึกธุรกรรมทางการเงินของบัญชี โดยข้อมูลการชำระเงินอาจซิงก์มาจาก Stripe หรือบันทึกด้วยตนเอง

สคีมา

interface Payment {
  id: string; // "pay..." - ตัวระบุที่ไม่ซ้ำ
  account_id: string;
  amount_cents: number;
  currency: string;
  status: "pending" | "succeeded" | "failed" | "canceled" | "refunded";
  paid_at: string | null;
  payment_method: string | null;
  external_id: string | null;
  external_customer_id: string | null;
  external_data: unknown | null;
}

คุณสมบัติ

PropertyTypeคำอธิบาย
idstringKSUID ที่ขึ้นต้นด้วย pay
account_idstringบัญชีเจ้าของ
amount_centsnumberจำนวนเงินหน่วยย่อย (เซ็นต์)
currencystringรหัสสกุลเงิน ISO 4217
statusenumสถานะตามวงจรชีวิตการชำระเงิน
paid_atstring?เวลาที่ชำระสำเร็จ
payment_methodstring?ประเภทวิธีชำระเงิน
external_idstring?รหัสการชำระเงินจากผู้ให้บริการ
external_customer_idstring?รหัสลูกค้าจากผู้ให้บริการ
external_dataobject?snapshot ดิบจากผู้ให้บริการ

ค่าสถานะ

Statusคำอธิบาย
pendingรอการประมวลผล
succeededชำระสำเร็จ
failedชำระไม่สำเร็จ
canceledยกเลิกการชำระเงิน
refundedคืนเงินให้ลูกค้าแล้ว

ตัวอย่าง

{
  "id": "pay123",
  "account_id": "acc456",
  "amount_cents": 9900,
  "currency": "usd",
  "status": "succeeded",
  "paid_at": "2026-01-15T10:30:00Z",
  "payment_method": "card",
  "external_id": "pi_abc123",
  "external_customer_id": "cus_xyz789"
}

ที่เกี่ยวข้อง

  • Payments - ระเบียนการชำระเงิน
  • Subscriptions - การจัดการการสมัครสมาชิก