สารบัญหน้านี้ (25)
- ภาพรวมโมดูล
- Workflow: ร้านใหม่ยืนยันตัวตน (KYB)
- Workflow: รายการเสี่ยงถูกพักตรวจ (review)
- Workflow: ลูกค้าโอนเองแล้วส่งสลิปทาง LINE
- The Merchant Verification object
- The Risk Assessment object
- The Dispute object
- Endpoints (11)
- POSTส่งคำขอยืนยันตัวตนร้านค้า (KYB)
- GETดูผลการยืนยันตัวตน
- POSTอัปโหลดไฟล์เอกสาร
- POSTประเมินความเสี่ยงรายการ
- POSTแจ้งผลจริงของรายการ
- GETตรวจข้อมูลบัตรจาก BIN
- POSTตรวจบัญชีธนาคาร
- POSTตรวจสลิปโอนเงิน
- GETรายการข้อพิพาท (chargeback)
- GETดูข้อพิพาท
- POSTส่งหลักฐานข้อพิพาท
- Webhooks (8)
- Errors
- Rate limit
- เวอร์ชันและ Changelog
- เครื่องมือ: ตัวอธิบายคะแนนความเสี่ยง
- เครื่องมือ: ตรวจ BIN
- PAYNARA
- Docs
- Payment API
- Verification
PAYNARA Payments API · โมดูล 4/5
Verification & Risk API
ยืนยันตัวตนร้านค้า (KYB) และบัญชีรับเงิน · ประเมินความเสี่ยงทุกรายการพร้อมเหตุผลที่อธิบายได้ · ตรวจข้อมูลบัตรจาก BIN · ตรวจสลิปโอนเงิน · จัดการข้อพิพาท
/v1/merchants/{merchant_id}/verifications/v1/files/v1/risk/v1/bins/v1/bank-accounts/v1/slips/v1/disputes

ภาพรวมโมดูล Verification
ใช้เมื่อไร
- ร้านใหม่สมัครผ่าน platform ของคุณ — ส่ง KYB ผ่าน API แทนการกรอกในแดชบอร์ด
- ยอดสูงผิดปกติ/บัตรต่างประเทศ — ดูคะแนนและเหตุผลก่อนส่งของ
- ยังรับโอนตรงบางส่วน — ตรวจสลิปอัตโนมัติจากแชต
- มี chargeback — ส่งหลักฐานผ่าน API ก่อนครบกำหนด
Object หลัก
-
Merchant Verificationคำขอยืนยันตัวตนของ ร้านขนมบ้านแม่ปลื้ม (ผ่านแล้ว) — ข้อมูลบุคคลแสดงแบบปิดบังเสมอ -
Risk Assessmentผลประเมินความเสี่ยงของ ORD-2610-0153 (คะแนน 12 = allow) — ทุกแต้มมีเหตุผล -
Disputeข้อพิพาท/chargeback 1 รายการ — ตัวอย่าง: ลูกค้าแจ้งว่าไม่ได้รับสินค้า
การยืนยันตัวตน
ทุกคำขอส่ง API key แบบ Bearer + X-Merchant-Id ของร้าน · sandbox ใช้ pn_test_… production ใช้ pn_live_… · แนะนำสร้าง restricted key ที่มีเฉพาะ scope ที่ระบบนั้นใช้ (เช่น ระบบบัญชีได้แค่ *:read)
POST https://sandbox.api.paynara.example/v1/merchants/{merchant_id}/verifications HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr
X-Merchant-Id: mch_baanmaeplub
Paynara-Version: 2026-08-01
Idempotency-Key: 7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f
Content-Type: application/json| scope | สิทธิ์ | ระดับ |
|---|---|---|
verifications:read | ดูผล KYB | อ่าน |
verifications:write | ส่ง KYB · ตรวจบัญชีธนาคาร | เขียน |
files:write | อัปโหลดเอกสาร/สลิป/หลักฐาน | เขียน |
risk:read | ประเมินความเสี่ยง · ตรวจ BIN | อ่าน |
risk:write | แจ้งผลจริงของรายการ (feedback) | เขียน |
slips:write | ตรวจสลิปโอนเงิน | เขียน |
disputes:read | ดูข้อพิพาท | อ่าน |
disputes:write | ส่งหลักฐานข้อพิพาท | เขียน |
ความสัมพันธ์กับโมดูลอื่น
- Paymentpayment.risk มาจากการประเมินอัตโนมัติ · รายการ review อยู่ในสถานะ requires_capture
- Refundตรวจบัญชีรับเงินคืนก่อนคืนเงิน PromptPay แบบระบุบัญชี
- Transactionข้อพิพาทหักยอดเป็น transaction ชนิด dispute และ adjustment
- Notificationรับ merchant.verification.* / risk.review_required / dispute.* ทาง webhook
ข้อควรรู้
-
PDPA — ข้อมูลบุคคล
เลขบัตรประชาชน เลขบัญชี ส่งครั้งเดียว เก็บเข้ารหัส ตอบกลับแบบปิดบัง · ใช้เพื่อ KYB/ป้องกันการฟอกเงินเท่านั้น · ผู้ประกอบการขอดูข้อมูลของตนได้ผ่านทีมงาน
-
คะแนนไม่ใช่คำตัดสิน
review = ให้คนตัดสิน · บันทึกเหตุผลทุกครั้ง · แจ้งผลจริงกลับด้วย feedback
-
เวลา ISO 8601 +07:00
กำหนดส่ง (due_by, evidence_due_by) เป็นเวลาไทย สิ้นสุด 23:59:59
-
ไฟล์ ≤ 10 MB
PDF JPG PNG · อัปโหลดก่อนแล้วอ้าง id · ดาวน์โหลดกลับไม่ได้
-
แบ่งหน้าแบบ cursor
GET /v1/disputes ใช้ limit + starting_after เหมือนทุกโมดูล
-
Sandbox
BIN 400000 / 510000 / 455612 / 400099 / 522000 เป็นข้อมูลสมมติ · id_number ลงท้าย 0004 ผ่าน KYB อัตโนมัติ
Workflow (3 เรื่อง)
แต่ละเรื่องดูได้ 2 แบบ: ภาพรวม สำหรับทุกคนในทีม และ Sequence ทีละขั้น สำหรับนักพัฒนา (กดเล่น หรือคลิกลูกศรเพื่อดูคำขอ/ผลลัพธ์จริงของขั้นนั้น) · ลูกศรประ = ไม่รอผล (webhook/คิว)
ร้านใหม่ยืนยันตัวตน (KYB) — เอกสารเบลอ ส่งใหม่ จนเปิดรับเงินจริง
ร้านขนมบ้านแม่ปลื้ม สมัคร 18 มี.ค. 2569 (บุคคลธรรมดาจดทะเบียนพาณิชย์) — ส่งคำขอซ้ำโดยไม่ตั้งใจ และภาพทะเบียนพาณิชย์เบลอ
- เจ้าของร้าน
- ระบบหลังร้านหน้าสมัคร
- PAYNARA API
- ทีมตรวจเอกสารอัตโนมัติ + เจ้าหน้าที่
- ธนาคารสยามรุ่ง (สมมติ)
- 1
เจ้าของร้าน → ระบบหลังร้าน
เจ้าของร้านถ่ายบัตรประชาชน ทะเบียนพาณิชย์ และหน้าสมุดบัญชีผ่านหน้าสมัคร
- 2
ระบบหลังร้าน → PAYNARA API
อัปโหลดทีละไฟล์ ได้ id ของแต่ละเอกสาร
POST /v1/files - 3
ระบบหลังร้าน → PAYNARA API
ส่งคำขอพร้อมข้อมูลกิจการและบัญชีรับเงิน
POST /v1/merchants/mch_baanmaeplub/verifications - 4
ระบบหลังร้าน → PAYNARA API
เจ้าของร้านกดส่งซ้ำเพราะหน้าโหลดช้า (คนละ Idempotency-Key) — ระบบปฏิเสธเพราะมีคำขอค้างอยู่
POST /v1/merchants/mch_baanmaeplub/verifications - 5
PAYNARA API → ทีมตรวจเอกสาร
เข้าคิวตรวจอัตโนมัติ (อ่านตัวอักษร เทียบชื่อ) แล้วต่อด้วยเจ้าหน้าที่
ไม่รอผล (async) - 6
ทีมตรวจเอกสาร → PAYNARA API
อ่านเลขทะเบียนไม่ได้ ตั้งสถานะ requires_input พร้อมเหตุผล
- 7
PAYNARA API → ระบบหลังร้าน
หลังร้านแสดงแถบเตือน "ส่งทะเบียนพาณิชย์ใหม่ภายใน 27 มี.ค."
POST /webhooks/paynaraไม่รอผล (async) - 8
ระบบหลังร้าน → PAYNARA API
เจ้าของร้านสแกนใหม่เป็น PDF 200 dpi
- 9
PAYNARA API → ธนาคารสยามรุ่ง (สมมติ)
ตรวจว่าบัญชีรับเงินเป็นชื่อเดียวกับผู้ประกอบการ (ไม่โอนเงินทดสอบ)
- 10
ทีมตรวจเอกสาร → PAYNARA API
เอกสารครบ ชื่อตรง ไม่มีชื่อในรายชื่อเฝ้าระวัง
- 11
PAYNARA API → ระบบหลังร้าน
เปิด live key และทุกช่องทางรับเงินทันที
ไม่รอผล (async)
ผ่าน KYB ภายใน 2 วันทำการหลังส่งเอกสารครั้งแรก · เปิดรับบัตร PromptPay ผ่อน และรับเงินโอนพร้อมกันทันที (capabilities = active)
กด เล่น หรือคลิกลูกศรในแผนภาพ เพื่อดูคำขอและผลลัพธ์ของแต่ละขั้น
1 เจ้าของร้าน ระบบหลังร้าน
ถ่ายเอกสาร 3 ชิ้น
เจ้าของร้านถ่ายบัตรประชาชน ทะเบียนพาณิชย์ และหน้าสมุดบัญชีผ่านหน้าสมัคร
2 ระบบหลังร้าน PAYNARA API
POST /v1/files ×3
อัปโหลดทีละไฟล์ ได้ id ของแต่ละเอกสาร
POST /v1/files HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr
{
"purpose": "business_document",
"filename": "commercial-registration.jpg",
"content_type": "image/jpeg",
"content_base64": "/9j/4AAQSkZJRgAB…"
}HTTP/1.1 201 Created
{
"id": "file_2Bc4De",
"object": "file",
"purpose": "business_document",
"size": 1288410
}3 ระบบหลังร้าน PAYNARA API
POST /v1/merchants/mch_baanmaeplub/verifications
ส่งคำขอพร้อมข้อมูลกิจการและบัญชีรับเงิน
POST /v1/merchants/mch_baanmaeplub/verifications HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr
{
"type": "individual",
"documents": [
{
"type": "id_card",
"file": "file_2Ab9Cd"
},
{
"type": "commercial_registration",
"file": "file_2Bc4De"
},
{
"type": "bank_book",
"file": "file_2De1Fg"
}
]
}HTTP/1.1 201 Created
{
"id": "vrf_K8m2Tq",
"status": "pending"
}4 ระบบหลังร้าน PAYNARA API
POST …/verifications (ซ้ำ)
เจ้าของร้านกดส่งซ้ำเพราะหน้าโหลดช้า (คนละ Idempotency-Key) — ระบบปฏิเสธเพราะมีคำขอค้างอยู่
POST /v1/merchants/mch_baanmaeplub/verifications HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9LrHTTP/1.1 409 Conflict
{
"error": {
"code": "verification_in_progress",
"message": "มีคำขอที่กำลังตรวจอยู่แล้ว (vrf_K8m2Tq)",
"request_id": "req_1Wd5Kr"
}
}5 PAYNARA API ทีมตรวจเอกสารasync
ส่งตรวจ
เข้าคิวตรวจอัตโนมัติ (อ่านตัวอักษร เทียบชื่อ) แล้วต่อด้วยเจ้าหน้าที่
6 ทีมตรวจเอกสาร PAYNARA API
ทะเบียนพาณิชย์เบลอ
อ่านเลขทะเบียนไม่ได้ ตั้งสถานะ requires_input พร้อมเหตุผล
7 PAYNARA API ระบบหลังร้านasync
webhook merchant.verification.requires_input
หลังร้านแสดงแถบเตือน "ส่งทะเบียนพาณิชย์ใหม่ภายใน 27 มี.ค."
POST /webhooks/paynara HTTP/1.1
{
"type": "merchant.verification.requires_input",
"data": {
"id": "vrf_K8m2Tq",
"status": "requires_input",
"requirements": {
"currently_due": [
"documents.commercial_registration"
],
"due_by": "2026-03-27T23:59:59+07:00",
"errors": [
{
"field": "documents.commercial_registration",
"code": "image_blurry",
"message": "ภาพเบลอ อ่านเลขทะเบียนไม่ได้ กรุณาสแกนใหม่ 200 dpi"
}
]
}
}
}HTTP/1.1 200 OK8 ระบบหลังร้าน PAYNARA API
POST /v1/files (สแกนใหม่)
เจ้าของร้านสแกนใหม่เป็น PDF 200 dpi
HTTP/1.1 201 Created
{
"id": "file_2Cd7Ef",
"object": "file"
}9 PAYNARA API ธนาคารสยามรุ่ง (สมมติ)
ตรวจชื่อบัญชี
ตรวจว่าบัญชีรับเงินเป็นชื่อเดียวกับผู้ประกอบการ (ไม่โอนเงินทดสอบ)
10 ทีมตรวจเอกสาร PAYNARA API
ผ่านทุกเอกสาร
เอกสารครบ ชื่อตรง ไม่มีชื่อในรายชื่อเฝ้าระวัง
11 PAYNARA API ระบบหลังร้านasync
webhook merchant.verification.verified
เปิด live key และทุกช่องทางรับเงินทันที
HTTP/1.1 200 OK
{
"id": "vrf_K8m2Tq",
"status": "verified",
"capabilities": {
"card_payments": "active",
"promptpay": "active",
"installment": "active",
"payouts": "active"
}
}ผ่าน KYB ภายใน 2 วันทำการหลังส่งเอกสารครั้งแรก · เปิดรับบัตร PromptPay ผ่อน และรับเงินโอนพร้อมกันทันที (capabilities = active)
รายการเสี่ยงถูกพักตรวจ (review) — ร้านโทรยืนยันไม่ได้ จึงยกเลิก
ORD-2610-0158: ชุดของขวัญ 8 ชุด ฿7,180 ด้วยบัตรต่างประเทศ (SG) จาก IP ต่างประเทศ ส่งต่างจังหวัด — คะแนน 66
- ผู้สั่งซื้อบัตร Mastercard SG
- เว็บร้าน
- PAYNARA API
- ระบบประเมินความเสี่ยง
- แอดมินร้าน
- 1
ผู้สั่งซื้อ → เว็บร้าน
ผู้สั่งซื้อใหม่สั่งชุดของขวัญ 8 ชุด ที่อยู่จัดส่งต่างจากที่อยู่บิล
- 2
เว็บร้าน → PAYNARA API
ยืนยันบัตร ผ่าน 3-D Secure
POST /v1/payments/pay_3Xy5Kd/confirm - 3
PAYNARA API → ระบบประเมินความเสี่ยง
ส่งสัญญาณทั้งหมดให้ระบบประเมินก่อนขออนุมัติ
- 4
ระบบประเมินความเสี่ยง → PAYNARA API
ยอดสูงกว่าค่าเฉลี่ย 5 เท่า + IP ต่างประเทศ + บัตรใช้ครั้งแรก + ที่อยู่ไม่ตรง
- 5
PAYNARA API → เว็บร้าน
อนุมัติวงเงินแต่ "พักไว้" ไม่เก็บเงิน หน้าเว็บแสดง "กำลังตรวจสอบคำสั่งซื้อ"
- 6
PAYNARA API → แอดมินร้าน
แจ้งแอดมินผ่านหลังร้าน + LINE ของร้าน
ไม่รอผล (async) - 7
แอดมินร้าน → PAYNARA API
ดูว่าเป็นบัตรอะไร ออกที่ไหน
GET /v1/bins/522000 - 8
แอดมินร้าน → PAYNARA API
ดูเหตุผลทีละปัจจัย
POST /v1/risk/assess - 9
แอดมินร้าน → ผู้สั่งซื้อ
โทรตามเบอร์ที่ให้ไว้ 2 ครั้งไม่มีผู้รับ ชื่อผู้รับไม่ตรงกับชื่อบนบัตร
- 10
แอดมินร้าน → PAYNARA API
ยกเลิกรายการ คืนวงเงินผู้ถือบัตร — ไม่มีค่าธรรมเนียม
POST /v1/payments/pay_3Xy5Kd/cancel - 11
แอดมินร้าน → PAYNARA API
แจ้งผลจริงให้ระบบปรับเกณฑ์ของร้าน
POST /v1/risk/assessments/ra_7Jm6Np/feedback
ไม่เสียสินค้า ฿7,180 และไม่มีค่าธรรมเนียม (ยกเลิกก่อน capture) · ตัดสินใจเสร็จใน 20 นาที · แจ้งผลกลับให้ระบบเรียนรู้
กด เล่น หรือคลิกลูกศรในแผนภาพ เพื่อดูคำขอและผลลัพธ์ของแต่ละขั้น
1 ผู้สั่งซื้อ เว็บร้าน
สั่ง 8 ชุด ส่งเชียงราย
ผู้สั่งซื้อใหม่สั่งชุดของขวัญ 8 ชุด ที่อยู่จัดส่งต่างจากที่อยู่บิล
2 เว็บร้าน PAYNARA API
POST …/confirm
ยืนยันบัตร ผ่าน 3-D Secure
POST /v1/payments/pay_3Xy5Kd/confirm HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr
{
"payment_method": "tok_sbx_mc_0516",
"device": {
"ip": "198.51.100.77"
}
}3 PAYNARA API ระบบประเมินความเสี่ยง
ประเมิน
ส่งสัญญาณทั้งหมดให้ระบบประเมินก่อนขออนุมัติ
4 ระบบประเมินความเสี่ยง PAYNARA API
คะแนน 66 → review
ยอดสูงกว่าค่าเฉลี่ย 5 เท่า + IP ต่างประเทศ + บัตรใช้ครั้งแรก + ที่อยู่ไม่ตรง
5 PAYNARA API เว็บร้าน
200 requires_capture (พัก)
อนุมัติวงเงินแต่ "พักไว้" ไม่เก็บเงิน หน้าเว็บแสดง "กำลังตรวจสอบคำสั่งซื้อ"
HTTP/1.1 200 OK
{
"id": "pay_3Xy5Kd",
"status": "requires_capture",
"risk": {
"score": 66,
"decision": "review"
},
"capture_before": "2026-10-19T10:38:20+07:00"
}6 PAYNARA API แอดมินร้านasync
webhook risk.review_required
แจ้งแอดมินผ่านหลังร้าน + LINE ของร้าน
7 แอดมินร้าน PAYNARA API
GET /v1/bins/522000
ดูว่าเป็นบัตรอะไร ออกที่ไหน
GET /v1/bins/522000 HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9LrHTTP/1.1 200 OK
{
"object": "bin",
"bin": "522000",
"brand": "mastercard",
"type": "credit",
"level": "world",
"country": "SG",
"issuer": "ธนาคารต่างประเทศ (สมมติ)",
"three_d_secure": true,
"note": "บัตรต่างประเทศ — ค่าธรรมเนียม 3.65%",
"installment_eligible": false,
"fee_key": "card_international",
"livemode": false
}8 แอดมินร้าน PAYNARA API
POST /v1/risk/assess
ดูเหตุผลทีละปัจจัย
POST /v1/risk/assess HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr
{
"payment": "pay_3Xy5Kd"
}HTTP/1.1 200 OK
{
"id": "ra_7Jm6Np",
"score": 66,
"decision": "review",
"reasons": [
{
"code": "amount_ratio",
"label": "ยอดเทียบค่าเฉลี่ยของลูกค้าคนนี้",
"points": 16
},
{
"code": "ip_country_mismatch",
"label": "IP อยู่ต่างประเทศ (ไม่ตรงประเทศบัตร)",
"points": 18
},
{
"code": "card_age_days",
"label": "บัตรนี้เคยใช้กับร้าน (วัน)",
"points": 14
},
{
"code": "three_ds_passed",
"label": "ผ่าน 3-D Secure แล้ว",
"points": -6
},
{
"code": "address_mismatch",
"label": "ที่อยู่จัดส่งต่างจังหวัดกับที่อยู่บิล",
"points": 6
}
]
}9 แอดมินร้าน ผู้สั่งซื้อ
โทรยืนยัน
โทรตามเบอร์ที่ให้ไว้ 2 ครั้งไม่มีผู้รับ ชื่อผู้รับไม่ตรงกับชื่อบนบัตร
10 แอดมินร้าน PAYNARA API
POST …/cancel (fraudulent)
ยกเลิกรายการ คืนวงเงินผู้ถือบัตร — ไม่มีค่าธรรมเนียม
POST /v1/payments/pay_3Xy5Kd/cancel HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr
{
"cancellation_reason": "fraudulent"
}HTTP/1.1 200 OK
{
"id": "pay_3Xy5Kd",
"status": "canceled",
"cancellation_reason": "fraudulent"
}11 แอดมินร้าน PAYNARA API
POST …/feedback
แจ้งผลจริงให้ระบบปรับเกณฑ์ของร้าน
POST /v1/risk/assessments/ra_7Jm6Np/feedback HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr
{
"outcome": "fraudulent"
}HTTP/1.1 200 OKไม่เสียสินค้า ฿7,180 และไม่มีค่าธรรมเนียม (ยกเลิกก่อน capture) · ตัดสินใจเสร็จใน 20 นาที · แจ้งผลกลับให้ระบบเรียนรู้
ลูกค้าโอนเองแล้วส่งสลิปทาง LINE — ตรวจก่อนส่งของ และจับสลิปใช้ซ้ำ
คำสั่งซื้อ ORD-2610-0156 ยอด ฿420 ลูกค้าโอนผ่านแอปธนาคารเอง (นอกระบบ PAYNARA) แล้วส่งภาพสลิปเข้า LINE OA ของร้าน
- ลูกค้า
- LINE OA ของร้านบอตรับสลิป
- เซิร์ฟเวอร์ร้าน
- PAYNARA API
- ระบบตรวจรายการธนาคาร
- 1
ลูกค้า → LINE OA ของร้าน
ลูกค้าส่งภาพสลิปในแชต
- 2
LINE OA ของร้าน → เซิร์ฟเวอร์ร้าน
บอตส่งภาพต่อให้เซิร์ฟเวอร์ร้าน
ไม่รอผล (async) - 3
เซิร์ฟเวอร์ร้าน → PAYNARA API
อัปโหลดภาพสลิป
- 4
เซิร์ฟเวอร์ร้าน → PAYNARA API
ตรวจสลิปพร้อมยอดที่ควรได้และเลขคำสั่งซื้อ
POST /v1/slips/verify - 5
PAYNARA API → ระบบตรวจรายการธนาคาร
ถามระบบธนาคารว่ามีรายการนี้จริงและเข้าบัญชีร้าน
- 6
PAYNARA API → เซิร์ฟเวอร์ร้าน
สลิปจริง ยอดตรง ผู้รับคือบัญชีร้าน
- 7
เซิร์ฟเวอร์ร้าน → LINE OA ของร้าน
บอตยืนยันการชำระและแจ้งวันจัดส่ง
- 8
เซิร์ฟเวอร์ร้าน → PAYNARA API
บ่ายวันเดียวกันมีผู้สั่งอีกรายส่งสลิปภาพเดียวกัน
POST /v1/slips/verify
ยืนยันยอดใน 3 วินาทีโดยไม่ต้องเปิดแอปธนาคารเทียบ · จับสลิปเดิมที่ถูกส่งซ้ำกับอีกคำสั่งซื้อได้ก่อนส่งของ
กด เล่น หรือคลิกลูกศรในแผนภาพ เพื่อดูคำขอและผลลัพธ์ของแต่ละขั้น
1 ลูกค้า LINE OA ของร้าน
ส่งภาพสลิป
ลูกค้าส่งภาพสลิปในแชต
2 LINE OA ของร้าน เซิร์ฟเวอร์ร้านasync
webhook ข้อความรูปภาพ
บอตส่งภาพต่อให้เซิร์ฟเวอร์ร้าน
3 เซิร์ฟเวอร์ร้าน PAYNARA API
POST /v1/files (slip)
อัปโหลดภาพสลิป
HTTP/1.1 201 Created
{
"id": "file_8Hj2Gh",
"purpose": "slip"
}4 เซิร์ฟเวอร์ร้าน PAYNARA API
POST /v1/slips/verify
ตรวจสลิปพร้อมยอดที่ควรได้และเลขคำสั่งซื้อ
POST /v1/slips/verify HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr
{
"file": "file_8Hj2Gh",
"expected_amount": 42000,
"order_ref": "ORD-2610-0156"
}5 PAYNARA API ระบบตรวจรายการธนาคาร
ตรวจเลขอ้างอิง
ถามระบบธนาคารว่ามีรายการนี้จริงและเข้าบัญชีร้าน
6 PAYNARA API เซิร์ฟเวอร์ร้าน
200 verified
สลิปจริง ยอดตรง ผู้รับคือบัญชีร้าน
HTTP/1.1 200 OK
{
"id": "slip_8Hj3Ka",
"status": "verified",
"amount": 42000,
"amount_match": true,
"receiver": {
"matches_merchant": true
}
}7 เซิร์ฟเวอร์ร้าน LINE OA ของร้าน
ตอบ "ได้รับเงินแล้ว"
บอตยืนยันการชำระและแจ้งวันจัดส่ง
8 เซิร์ฟเวอร์ร้าน PAYNARA API
สลิปเดิมกับคำสั่งซื้ออื่น
บ่ายวันเดียวกันมีผู้สั่งอีกรายส่งสลิปภาพเดียวกัน
POST /v1/slips/verify HTTP/1.1
Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr
{
"file": "file_8Jk5Hm",
"expected_amount": 42000,
"order_ref": "ORD-2610-0163"
}HTTP/1.1 409 Conflict
{
"error": {
"code": "slip_duplicate",
"message": "สลิปนี้ถูกใช้กับ ORD-2610-0156 แล้ว",
"duplicate_of": "slip_8Hj3Ka",
"request_id": "req_6Fh2Ns"
}
}ยืนยันยอดใน 3 วินาทีโดยไม่ต้องเปิดแอปธนาคารเทียบ · จับสลิปเดิมที่ถูกส่งซ้ำกับอีกคำสั่งซื้อได้ก่อนส่งของ
Objects
The Merchant Verification object
คำขอยืนยันตัวตนของ ร้านขนมบ้านแม่ปลื้ม (ผ่านแล้ว) — ข้อมูลบุคคลแสดงแบบปิดบังเสมอ
idstringไม่บังคับอ่านอย่างเดียวรหัสคำขอตรวจสอบ (ขึ้นต้น vrf_)
objectstringไม่บังคับอ่านอย่างเดียวชนิด object
merchantstringไม่บังคับอ่านอย่างเดียวร้านค้า
typestringจำเป็นประเภทผู้ประกอบการ (กำหนดเอกสารที่ต้องใช้)
statusstringไม่บังคับอ่านอย่างเดียวpending = กำลังตรวจ (1–2 วันทำการ) · requires_input = ต้องส่งเพิ่ม · verified = ผ่าน · rejected = ไม่ผ่าน
businessobjectจำเป็นข้อมูลกิจการ
ฟิลด์ย่อยของ
business(6)namestringจำเป็นชื่อร้าน (ตรงกับเอกสาร)
name_enstringไม่บังคับชื่อภาษาอังกฤษ (แสดงในใบแจ้งยอดบัตร)
mccstringจำเป็นรหัสประเภทธุรกิจ (MCC 4 หลัก)
websitestring · uriไม่บังคับเว็บ/หน้าร้านออนไลน์ (ใช้ตรวจสินค้าจริง)
phonestring · phone (E.164)ไม่บังคับเบอร์ติดต่อ (ตอบกลับแบบปิดบัง)
addressobjectไม่บังคับที่อยู่กิจการ
ฟิลด์ย่อยของ
address(4)line1stringไม่บังคับบ้านเลขที่ ถนน
districtstringไม่บังคับเขต/อำเภอ
provincestringไม่บังคับจังหวัด
postal_codestringไม่บังคับรหัสไปรษณีย์ 5 หลัก
representativeobjectจำเป็นผู้มีอำนาจ/เจ้าของ (เก็บเข้ารหัส ตอบกลับแบบปิดบังตาม PDPA)
ฟิลด์ย่อยของ
representative(3)namestringจำเป็นชื่อ-นามสกุล
id_numberstringจำเป็นเลขประจำตัวประชาชน 13 หลัก
nationalitystringไม่บังคับสัญชาติ (ISO 3166-1)
documentsarray<object>จำเป็นเอกสาร (อัปโหลดผ่าน POST /v1/files ก่อน)
ฟิลด์ย่อยของ
documents(4)typestringไม่บังคับชนิดเอกสาร
filestringไม่บังคับid ไฟล์ (file_…)
statusstringไม่บังคับอ่านอย่างเดียวผลตรวจเอกสาร
rejection_reasonstringไม่บังคับอ่านอย่างเดียวเหตุผลที่ไม่ผ่าน
bank_accountobjectจำเป็นบัญชีรับเงินโอน (ต้องชื่อเดียวกับผู้ประกอบการ)
ฟิลด์ย่อยของ
bank_account(4)bankstringไม่บังคับรหัสธนาคาร (สมมติ)
account_numberstringไม่บังคับเลขบัญชี (ส่งครั้งเดียว · ตอบกลับเฉพาะ account_last4)
account_last4stringไม่บังคับอ่านอย่างเดียวเลขท้าย 4 หลัก
name_matchstringไม่บังคับอ่านอย่างเดียวผลเทียบชื่อบัญชีกับผู้ประกอบการ
requirementsobjectไม่บังคับอ่านอย่างเดียวสิ่งที่ต้องส่งเพิ่ม
ฟิลด์ย่อยของ
requirements(3)currently_duearray<string>ไม่บังคับฟิลด์/เอกสารที่ต้องส่ง
due_bystring · date-timeไม่บังคับส่งภายใน (เกินแล้วคำขอเป็น rejected)
errorsarray<object>ไม่บังคับรายละเอียดปัญหา (field code message)
capabilitiesobjectไม่บังคับอ่านอย่างเดียวความสามารถที่เปิดใช้หลังผ่าน
ฟิลด์ย่อยของ
capabilities(4)card_paymentsstringไม่บังคับรับบัตร
promptpaystringไม่บังคับรับ PromptPay
installmentstringไม่บังคับผ่อนชำระ
payoutsstringไม่บังคับรับเงินโอน
submitted_atstring · date-timeไม่บังคับอ่านอย่างเดียวเวลาส่ง
verified_atstring · date-timeไม่บังคับอ่านอย่างเดียวเวลาผ่าน
createdstring · date-timeไม่บังคับอ่านอย่างเดียวเวลาสร้าง (ISO 8601 +07:00)
livemodebooleanไม่บังคับอ่านอย่างเดียวtrue = production · false = sandbox
{
"id": "vrf_K8m2Tq",
"object": "merchant_verification",
"merchant": "mch_baanmaeplub",
"type": "individual",
"status": "verified",
"business": {
"name": "ร้านขนมบ้านแม่ปลื้ม",
"name_en": "Baan Mae Pluem Desserts",
"mcc": "5441",
"mcc_label": "ร้านขนม/ลูกกวาด",
"website": "https://baanmaeplub.example",
"phone": "08x-xxx-0141",
"address": {
"line1": "88/12 ซอยประชาอุทิศ 33 (สมมติ)",
"district": "ทุ่งครุ",
"province": "กรุงเทพมหานคร",
"postal_code": "10140"
}
},
"representative": {
"name": "ปลื้มจิต ใจ***",
"id_number": "1-1037-xxxxx-xx-4",
"nationality": "TH"
},
"documents": [
{
"type": "id_card",
"file": "file_2Ab9Cd",
"status": "accepted"
},
{
"type": "commercial_registration",
"file": "file_2Cd7Ef",
"status": "accepted"
},
{
"type": "bank_book",
"file": "file_2De1Fg",
"status": "accepted"
}
],
"bank_account": {
"bank": "srr",
"bank_name": "ธนาคารสยามรุ่ง (สมมติ)",
"account_last4": "4821",
"name_match": "match"
},
"requirements": {
"currently_due": [],
"due_by": null,
"errors": []
},
"capabilities": {
"card_payments": "active",
"promptpay": "active",
"installment": "active",
"payouts": "active"
},
"submitted_at": "2026-03-18T16:20:44+07:00",
"verified_at": "2026-03-20T15:42:10+07:00",
"created": "2026-03-18T16:20:44+07:00",
"livemode": true
}
The Risk Assessment object
ผลประเมินความเสี่ยงของ ORD-2610-0153 (คะแนน 12 = allow) — ทุกแต้มมีเหตุผล
idstringไม่บังคับอ่านอย่างเดียวรหัสผลประเมิน (ra_)
objectstringไม่บังคับอ่านอย่างเดียวชนิด object
paymentstringไม่บังคับpayment ที่ประเมิน (หรือ null ถ้าประเมินล่วงหน้าจากข้อมูลที่ส่ง)
scoreintegerไม่บังคับอ่านอย่างเดียวคะแนน 0–100 (สูง = เสี่ยง)
decisionstringไม่บังคับอ่านอย่างเดียวallow (< 40) · review (40–69: พักไว้ให้ร้านตัดสิน) · block (≥ 70: ปฏิเสธอัตโนมัติ)
baseintegerไม่บังคับอ่านอย่างเดียวคะแนนตั้งต้นตามประเภทร้าน
reasonsarray<object>ไม่บังคับอ่านอย่างเดียวปัจจัยที่ทำให้คะแนนเปลี่ยน (อธิบายได้ทุกแต้ม)
ฟิลด์ย่อยของ
reasons(3)codestringไม่บังคับรหัสปัจจัย
labelstringไม่บังคับคำอธิบายภาษาไทย
pointsintegerไม่บังคับแต้มที่บวก/ลบ
signalsobjectไม่บังคับอ่านอย่างเดียวค่าที่ใช้คำนวณ
ฟิลด์ย่อยของ
signals(6)amount_rationumberไม่บังคับยอดเทียบค่าเฉลี่ยของลูกค้า (เท่า)
ip_countrystringไม่บังคับประเทศของ IP
card_countrystringไม่บังคับประเทศผู้ออกบัตร
velocity_1hintegerไม่บังคับจำนวนรายการจากบัตร/อุปกรณ์เดียวใน 1 ชม.
card_age_daysintegerไม่บังคับบัตรเคยใช้กับร้านมาแล้วกี่วัน (0 = ครั้งแรก)
three_ds_passedbooleanไม่บังคับผ่าน 3-D Secure
thresholdsobjectไม่บังคับอ่านอย่างเดียวเกณฑ์ของร้าน (ปรับได้ในแดชบอร์ด)
ฟิลด์ย่อยของ
thresholds(2)reviewintegerไม่บังคับเริ่มพักตรวจ
blockintegerไม่บังคับเริ่มปฏิเสธ
model_versionstringไม่บังคับอ่านอย่างเดียวรุ่นโมเดล
createdstring · date-timeไม่บังคับอ่านอย่างเดียวเวลาสร้าง (ISO 8601 +07:00)
livemodebooleanไม่บังคับอ่านอย่างเดียวtrue = production · false = sandbox
{
"id": "ra_7Hk3Lm",
"object": "risk_assessment",
"payment": "pay_3NqL8k",
"score": 12,
"decision": "allow",
"base": 18,
"reasons": [
{
"code": "three_ds_passed",
"label": "ผ่าน 3-D Secure แล้ว",
"points": -6
}
],
"signals": {
"amount_ratio": 1.2,
"ip_country_mismatch": 0,
"velocity_1h": 1,
"card_age_days": 210,
"email_new": 0,
"three_ds_passed": 1,
"address_mismatch": 0,
"ip_country": "TH",
"card_country": "TH"
},
"thresholds": {
"review": 40,
"block": 70
},
"model_version": "risk-2026.09",
"created": "2026-10-12T10:14:31+07:00",
"livemode": false
}
The Dispute object
ข้อพิพาท/chargeback 1 รายการ — ตัวอย่าง: ลูกค้าแจ้งว่าไม่ได้รับสินค้า
idstringไม่บังคับอ่านอย่างเดียวรหัสข้อพิพาท (dsp_)
objectstringไม่บังคับอ่านอย่างเดียวชนิด object
paymentstringไม่บังคับอ่านอย่างเดียวpayment ที่ถูกโต้แย้ง
order_refstringไม่บังคับอ่านอย่างเดียวเลขคำสั่งซื้อ
amountintegerไม่บังคับอ่านอย่างเดียวยอดที่ถูกระงับ (หักจากยอดคงเหลือทันที)
currencystringไม่บังคับอ่านอย่างเดียวสกุลเงิน
reasonstringไม่บังคับอ่านอย่างเดียวเหตุผลจากผู้ถือบัตร
network_reason_codestringไม่บังคับอ่านอย่างเดียวรหัสเหตุผลของเครือข่ายบัตร
statusstringไม่บังคับอ่านอย่างเดียวneeds_response = ร้านต้องส่งหลักฐาน · under_review = ธนาคารพิจารณา · won / lost · accepted = ร้านยอมรับ
evidence_due_bystring · date-timeไม่บังคับอ่านอย่างเดียวส่งหลักฐานภายใน (ประมาณ 12 วัน)
evidenceobjectไม่บังคับหลักฐานที่ส่ง
ฟิลด์ย่อยของ
evidence(5)product_descriptionstringไม่บังคับรายละเอียดสินค้า
shipping_documentationstringไม่บังคับไฟล์ใบส่งของ (file_…)
delivery_proofstringไม่บังคับไฟล์หลักฐานส่งถึง เช่น ภาพถ่าย/ลายเซ็น (file_…)
customer_communicationstringไม่บังคับไฟล์ข้อความคุยกับลูกค้า (file_…)
notesstringไม่บังคับคำชี้แจง (≤ 2,000 ตัว)
evidence_submitted_atstring · date-timeไม่บังคับอ่านอย่างเดียวเวลาส่งหลักฐาน
feeintegerไม่บังคับอ่านอย่างเดียวค่าดำเนินการข้อพิพาท (คืนให้ถ้าร้านชนะ)
balance_transactionsarray<string>ไม่บังคับอ่านอย่างเดียวtransaction ที่หัก/คืนเงิน (หน้า Transaction)
cardobjectไม่บังคับอ่านอย่างเดียวบัตรที่ใช้ (ปิดบัง)
ฟิลด์ย่อยของ
card(2)brandstringไม่บังคับเครือข่าย
last4stringไม่บังคับเลขท้าย
createdstring · date-timeไม่บังคับอ่านอย่างเดียวเวลาสร้าง (ISO 8601 +07:00)
closed_atstring · date-timeไม่บังคับอ่านอย่างเดียวเวลาปิด
livemodebooleanไม่บังคับอ่านอย่างเดียวtrue = production · false = sandbox
{
"id": "dsp_6Bn2Lw",
"object": "dispute",
"payment": "pay_1Aa9Cc",
"order_ref": "ORD-2609-0388",
"amount": 38000,
"currency": "THB",
"reason": "product_not_received",
"network_reason_code": "13.1",
"status": "needs_response",
"evidence_due_by": "2026-10-20T23:59:59+07:00",
"evidence": {
"product_description": null,
"shipping_documentation": null,
"delivery_proof": null,
"customer_communication": null,
"notes": null
},
"evidence_submitted_at": null,
"fee": 15000,
"balance_transactions": [
"txn_DSP6Bn2",
"txn_ADJ8Ws2"
],
"card": {
"brand": "visa",
"last4": "0002"
},
"created": "2026-10-08T16:20:00+07:00",
"closed_at": null,
"livemode": false
}Endpoints (11)
| Method | Path | ทำอะไร | scope |
|---|---|---|---|
| POST | /v1/merchants/{merchant_id}/verifications | ส่งคำขอยืนยันตัวตนร้านค้า (KYB) | verifications:write |
| GET | /v1/merchants/{merchant_id}/verifications/{verification_id} | ดูผลการยืนยันตัวตน | verifications:read |
| POST | /v1/files | อัปโหลดไฟล์เอกสาร | files:write |
| POST | /v1/risk/assess | ประเมินความเสี่ยงรายการ | risk:read |
| POST | /v1/risk/assessments/{assessment_id}/feedback | แจ้งผลจริงของรายการBeta | risk:write |
| GET | /v1/bins/{bin} | ตรวจข้อมูลบัตรจาก BIN | risk:read |
| POST | /v1/bank-accounts/verify | ตรวจบัญชีธนาคาร | verifications:write |
| POST | /v1/slips/verify | ตรวจสลิปโอนเงิน | slips:write |
| GET | /v1/disputes | รายการข้อพิพาท (chargeback) | disputes:read |
| GET | /v1/disputes/{dispute_id} | ดูข้อพิพาท | disputes:read |
| POST | /v1/disputes/{dispute_id}/evidence | ส่งหลักฐานข้อพิพาท | disputes:write |
ส่งคำขอยืนยันตัวตนร้านค้า (KYB)
POST/v1/merchants/{merchant_id}/verifications
ส่งข้อมูลกิจการ ผู้มีอำนาจ เอกสาร และบัญชีรับเงิน เพื่อเปิดรับเงินจริง (live) — ผลภายใน 1–2 วันทำการ แจ้งทาง webhook merchant.verification.*
Path parameterspath
merchant_idstringจำเป็นรหัสร้านค้า
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Idempotency-Keystring · uuidจำเป็นกันรายการซ้ำเมื่อส่งซ้ำ (เช่น เน็ตหลุด) — ใช้ค่าเดิมได้ภายใน 24 ชม.
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
Request bodyapplication/json
typestringจำเป็นประเภทผู้ประกอบการ (กำหนดเอกสารที่ต้องใช้)
businessobjectจำเป็นข้อมูลกิจการ
ฟิลด์ย่อยของ
business(6)namestringจำเป็นชื่อร้าน (ตรงกับเอกสาร)
name_enstringไม่บังคับชื่อภาษาอังกฤษ (แสดงในใบแจ้งยอดบัตร)
mccstringจำเป็นรหัสประเภทธุรกิจ (MCC 4 หลัก)
websitestring · uriไม่บังคับเว็บ/หน้าร้านออนไลน์ (ใช้ตรวจสินค้าจริง)
phonestring · phone (E.164)ไม่บังคับเบอร์ติดต่อ (ตอบกลับแบบปิดบัง)
addressobjectไม่บังคับที่อยู่กิจการ
ฟิลด์ย่อยของ
address(4)line1stringไม่บังคับบ้านเลขที่ ถนน
districtstringไม่บังคับเขต/อำเภอ
provincestringไม่บังคับจังหวัด
postal_codestringไม่บังคับรหัสไปรษณีย์ 5 หลัก
representativeobjectจำเป็นผู้มีอำนาจ/เจ้าของ (เก็บเข้ารหัส ตอบกลับแบบปิดบังตาม PDPA)
ฟิลด์ย่อยของ
representative(3)namestringจำเป็นชื่อ-นามสกุล
id_numberstringจำเป็นเลขประจำตัวประชาชน 13 หลัก
nationalitystringไม่บังคับสัญชาติ (ISO 3166-1)
documentsarray<object>จำเป็นเอกสาร (อัปโหลดผ่าน POST /v1/files ก่อน)
ฟิลด์ย่อยของ
documents(2)typestringไม่บังคับชนิดเอกสาร
filestringไม่บังคับid ไฟล์ (file_…)
bank_accountobjectจำเป็นบัญชีรับเงินโอน (ต้องชื่อเดียวกับผู้ประกอบการ)
ฟิลด์ย่อยของ
bank_account(2)bankstringไม่บังคับรหัสธนาคาร (สมมติ)
account_numberstringไม่บังคับเลขบัญชี (ส่งครั้งเดียว · ตอบกลับเฉพาะ account_last4)
ผลลัพธ์
- 201รับคำขอแล้ว กำลังตรวจ
- 409
verification_in_progressมีคำขอตรวจสอบค้างอยู่ - 400
parameter_missingขาดฟิลด์ที่จำเป็น - 400
file_invalidไฟล์ไม่ถูกต้อง - 422
bank_account_name_mismatchชื่อบัญชีไม่ตรงกับร้าน - 403
merchant_mismatchX-Merchant-Id ไม่ตรงกับ key - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- ข้อมูลบุคคล (เลขบัตรประชาชน เลขบัญชี) ส่งครั้งเดียว เก็บเข้ารหัส และตอบกลับแบบปิดบังเสมอ — เก็บตลอดอายุสัญญา + 10 ปีตามกฎหมายป้องกันการฟอกเงิน
- sandbox: ใช้ id_number ลงท้าย 0004 = ผ่านอัตโนมัติ · ลงท้าย 0005 = requires_input
curl -X POST "https://sandbox.api.paynara.example/v1/merchants/mch_baanmaeplub/verifications" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub" \
-d '{
"type": "individual",
"business": {
"name": "ร้านขนมบ้านแม่ปลื้ม",
"name_en": "Baan Mae Pluem Desserts",
"mcc": "5441",
"website": "https://baanmaeplub.example",
"phone": "+66800000141",
"address": {
"line1": "88/12 ซอยประชาอุทิศ 33 (สมมติ)",
"district": "ทุ่งครุ",
"province": "กรุงเทพมหานคร",
"postal_code": "10140"
}
},
"representative": {
"name": "ปลื้มจิต ใจดี (สมมติ)",
"id_number": "1103700000004",
"nationality": "TH"
},
"documents": [
{
"type": "id_card",
"file": "file_2Ab9Cd"
},
{
"type": "commercial_registration",
"file": "file_2Bc4De"
},
{
"type": "bank_book",
"file": "file_2De1Fg"
}
],
"bank_account": {
"bank": "srr",
"account_number": "0004821000"
}
}'const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/merchants/mch_baanmaeplub/verifications', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': '7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f',
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
body: JSON.stringify({
"type": "individual",
"business": {
"name": "ร้านขนมบ้านแม่ปลื้ม",
"name_en": "Baan Mae Pluem Desserts",
"mcc": "5441",
"website": "https://baanmaeplub.example",
"phone": "+66800000141",
"address": {
"line1": "88/12 ซอยประชาอุทิศ 33 (สมมติ)",
"district": "ทุ่งครุ",
"province": "กรุงเทพมหานคร",
"postal_code": "10140"
}
},
"representative": {
"name": "ปลื้มจิต ใจดี (สมมติ)",
"id_number": "1103700000004",
"nationality": "TH"
},
"documents": [
{
"type": "id_card",
"file": "file_2Ab9Cd"
},
{
"type": "commercial_registration",
"file": "file_2Bc4De"
},
{
"type": "bank_book",
"file": "file_2De1Fg"
}
],
"bank_account": {
"bank": "srr",
"account_number": "0004821000"
}
}),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.post(
"https://sandbox.api.paynara.example/v1/merchants/mch_baanmaeplub/verifications",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"Idempotency-Key": "7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
json={
"type": "individual",
"business": {
"name": "ร้านขนมบ้านแม่ปลื้ม",
"name_en": "Baan Mae Pluem Desserts",
"mcc": "5441",
"website": "https://baanmaeplub.example",
"phone": "+66800000141",
"address": {
"line1": "88/12 ซอยประชาอุทิศ 33 (สมมติ)",
"district": "ทุ่งครุ",
"province": "กรุงเทพมหานคร",
"postal_code": "10140"
}
},
"representative": {
"name": "ปลื้มจิต ใจดี (สมมติ)",
"id_number": "1103700000004",
"nationality": "TH"
},
"documents": [
{
"type": "id_card",
"file": "file_2Ab9Cd"
},
{
"type": "commercial_registration",
"file": "file_2Bc4De"
},
{
"type": "bank_book",
"file": "file_2De1Fg"
}
],
"bank_account": {
"bank": "srr",
"account_number": "0004821000"
}
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"id": "vrf_K8m2Tq",
"object": "merchant_verification",
"merchant": "mch_baanmaeplub",
"type": "individual",
"status": "pending",
"business": {
"name": "ร้านขนมบ้านแม่ปลื้ม",
"name_en": "Baan Mae Pluem Desserts",
"mcc": "5441",
"mcc_label": "ร้านขนม/ลูกกวาด",
"website": "https://baanmaeplub.example",
"phone": "08x-xxx-0141",
"address": {
"line1": "88/12 ซอยประชาอุทิศ 33 (สมมติ)",
"district": "ทุ่งครุ",
"province": "กรุงเทพมหานคร",
"postal_code": "10140"
}
},
"representative": {
"name": "ปลื้มจิต ใจ***",
"id_number": "1-1037-xxxxx-xx-4",
"nationality": "TH"
},
"documents": [
{
"type": "id_card",
"file": "file_2Ab9Cd",
"status": "accepted"
},
{
"type": "commercial_registration",
"file": "file_2Cd7Ef",
"status": "accepted"
},
{
"type": "bank_book",
"file": "file_2De1Fg",
"status": "reviewing"
}
],
"bank_account": {
"bank": "srr",
"bank_name": "ธนาคารสยามรุ่ง (สมมติ)",
"account_last4": "4821",
"name_match": "pending"
},
"requirements": {
"currently_due": [],
"due_by": null,
"errors": []
},
"capabilities": {
"card_payments": "inactive",
"promptpay": "inactive",
"installment": "inactive",
"payouts": "inactive"
},
"submitted_at": "2026-03-18T16:20:44+07:00",
"verified_at": null,
"created": "2026-03-18T16:20:44+07:00",
"livemode": true
}{
"error": {
"code": "verification_in_progress",
"message": "มีคำขอตรวจสอบค้างอยู่",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#verification_in_progress"
}
}{
"error": {
"code": "parameter_missing",
"message": "ขาดฟิลด์ที่จำเป็น",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#parameter_missing"
}
}{
"error": {
"code": "file_invalid",
"message": "ไฟล์ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#file_invalid"
}
}{
"error": {
"code": "bank_account_name_mismatch",
"message": "ชื่อบัญชีไม่ตรงกับร้าน",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#bank_account_name_mismatch"
}
}{
"error": {
"code": "merchant_mismatch",
"message": "X-Merchant-Id ไม่ตรงกับ key",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#merchant_mismatch"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}ดูผลการยืนยันตัวตน
GET/v1/merchants/{merchant_id}/verifications/{verification_id}
สถานะ เอกสารที่ผ่าน/ไม่ผ่าน สิ่งที่ต้องส่งเพิ่ม (requirements) และความสามารถที่เปิดแล้ว
Path parameterspath
merchant_idstringจำเป็นรหัสร้านค้า
verification_idstringจำเป็นรหัสคำขอ
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
ผลลัพธ์
- 200ผ่านแล้ว (20 มี.ค. 2569)
- 404
resource_not_foundไม่พบรายการ - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- requirements.currently_due คือรายการเอกสารที่ยังขาด — แสดงให้เจ้าของร้านแก้ทีละข้อ
- ผลตรวจปกติ 1–2 วันทำการ · ระหว่าง pending ใช้ test key ได้ตามปกติ
curl -X GET "https://sandbox.api.paynara.example/v1/merchants/mch_baanmaeplub/verifications/vrf_K8m2Tq" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub"const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/merchants/mch_baanmaeplub/verifications/vrf_K8m2Tq', {
method: 'GET',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.get(
"https://sandbox.api.paynara.example/v1/merchants/mch_baanmaeplub/verifications/vrf_K8m2Tq",
headers={
"Authorization": f"Bearer {API_KEY}",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"id": "vrf_K8m2Tq",
"object": "merchant_verification",
"merchant": "mch_baanmaeplub",
"type": "individual",
"status": "verified",
"business": {
"name": "ร้านขนมบ้านแม่ปลื้ม",
"name_en": "Baan Mae Pluem Desserts",
"mcc": "5441",
"mcc_label": "ร้านขนม/ลูกกวาด",
"website": "https://baanmaeplub.example",
"phone": "08x-xxx-0141",
"address": {
"line1": "88/12 ซอยประชาอุทิศ 33 (สมมติ)",
"district": "ทุ่งครุ",
"province": "กรุงเทพมหานคร",
"postal_code": "10140"
}
},
"representative": {
"name": "ปลื้มจิต ใจ***",
"id_number": "1-1037-xxxxx-xx-4",
"nationality": "TH"
},
"documents": [
{
"type": "id_card",
"file": "file_2Ab9Cd",
"status": "accepted"
},
{
"type": "commercial_registration",
"file": "file_2Cd7Ef",
"status": "accepted"
},
{
"type": "bank_book",
"file": "file_2De1Fg",
"status": "accepted"
}
],
"bank_account": {
"bank": "srr",
"bank_name": "ธนาคารสยามรุ่ง (สมมติ)",
"account_last4": "4821",
"name_match": "match"
},
"requirements": {
"currently_due": [],
"due_by": null,
"errors": []
},
"capabilities": {
"card_payments": "active",
"promptpay": "active",
"installment": "active",
"payouts": "active"
},
"submitted_at": "2026-03-18T16:20:44+07:00",
"verified_at": "2026-03-20T15:42:10+07:00",
"created": "2026-03-18T16:20:44+07:00",
"livemode": true
}{
"error": {
"code": "resource_not_found",
"message": "ไม่พบรายการ",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#resource_not_found"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}อัปโหลดไฟล์เอกสาร
อัปโหลดเอกสาร KYB สลิป หรือหลักฐานข้อพิพาท แล้วนำ id ไปอ้างใน endpoint อื่น · รองรับทั้ง multipart/form-data (ฟิลด์ file) และ JSON แบบ base64 (ตัวอย่างนี้)
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Idempotency-Keystring · uuidจำเป็นกันรายการซ้ำเมื่อส่งซ้ำ (เช่น เน็ตหลุด) — ใช้ค่าเดิมได้ภายใน 24 ชม.
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
Request bodyapplication/json
purposestringจำเป็นวัตถุประสงค์ (กำหนดชนิดไฟล์และระยะเวลาเก็บ)
filenamestringจำเป็นชื่อไฟล์
content_typestringจำเป็นชนิดไฟล์
content_base64stringจำเป็นเนื้อไฟล์เข้ารหัส base64 (≤ 10 MB ก่อนเข้ารหัส)
ผลลัพธ์
- 201อัปโหลดแล้ว
- 400
file_invalidไฟล์ไม่ถูกต้อง - 413
file_too_largeไฟล์ใหญ่เกิน - 400
parameter_missingขาดฟิลด์ที่จำเป็น - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- ไฟล์ purpose = slip เก็บ 90 วัน · เอกสาร KYB เก็บตลอดอายุสัญญา · ดาวน์โหลดกลับไม่ได้ (เพื่อความปลอดภัย)
curl -X POST "https://sandbox.api.paynara.example/v1/files" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub" \
-d '{
"purpose": "business_document",
"filename": "commercial-registration-rescan.pdf",
"content_type": "application/pdf",
"content_base64": "JVBERi0xLjcKJcfsj6IK…"
}'const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/files', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': '7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f',
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
body: JSON.stringify({
"purpose": "business_document",
"filename": "commercial-registration-rescan.pdf",
"content_type": "application/pdf",
"content_base64": "JVBERi0xLjcKJcfsj6IK…"
}),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.post(
"https://sandbox.api.paynara.example/v1/files",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"Idempotency-Key": "7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
json={
"purpose": "business_document",
"filename": "commercial-registration-rescan.pdf",
"content_type": "application/pdf",
"content_base64": "JVBERi0xLjcKJcfsj6IK…"
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"id": "file_2Cd7Ef",
"object": "file",
"purpose": "business_document",
"filename": "commercial-registration-rescan.pdf",
"content_type": "application/pdf",
"size": 482113,
"sha256": "9b2e…41c0",
"expires_at": null,
"created": "2026-03-19T09:12:30+07:00",
"livemode": true
}{
"error": {
"code": "file_invalid",
"message": "ไฟล์ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#file_invalid"
}
}{
"error": {
"code": "file_too_large",
"message": "ไฟล์ใหญ่เกิน",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#file_too_large"
}
}{
"error": {
"code": "parameter_missing",
"message": "ขาดฟิลด์ที่จำเป็น",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#parameter_missing"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}ประเมินความเสี่ยงรายการ
คืนคะแนนความเสี่ยง 0–100 พร้อมเหตุผลทีละปัจจัย — ทุก payment ถูกประเมินอัตโนมัติอยู่แล้ว endpoint นี้ใช้ดูคำอธิบาย หรือประเมินล่วงหน้าก่อนสร้าง payment (เช่น ก่อนยืนยันสั่งทำสินค้าราคาสูง)
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
Request bodyapplication/json
paymentstringไม่บังคับประเมิน/อธิบาย payment ที่มีอยู่ (ส่งค่านี้อย่างเดียวพอ)
amountintegerไม่บังคับยอด (ประเมินล่วงหน้า)
customerstringไม่บังคับรหัสลูกค้า (ใช้ประวัติ/ค่าเฉลี่ย)
card_binstringไม่บังคับBIN 6 หลัก (ประเมินล่วงหน้า)
ipstringไม่บังคับIP ของลูกค้า
shipping_provincestringไม่บังคับจังหวัดจัดส่ง
emailstring · emailไม่บังคับอีเมลลูกค้า (ใช้ตรวจอายุอีเมล — ไม่เก็บ)
ผลลัพธ์
- 200ORD-2610-0153 — ความเสี่ยงต่ำ
- 400
parameter_missingขาดฟิลด์ที่จำเป็น - 404
resource_not_foundไม่พบรายการ - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- เครื่องมือ "ตัวอธิบายคะแนนความเสี่ยง" ท้ายหน้าใช้สูตรเดียวกับตัวอย่างนี้ ลองปรับปัจจัยดูได้
- ห้ามใช้คะแนนเพียงอย่างเดียวปฏิเสธลูกค้า — review ควรมีคนตัดสินและบันทึกเหตุผล
curl -X POST "https://sandbox.api.paynara.example/v1/risk/assess" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Content-Type: application/json" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub" \
-d '{
"payment": "pay_3NqL8k"
}'const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/risk/assess', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
body: JSON.stringify({
"payment": "pay_3NqL8k"
}),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.post(
"https://sandbox.api.paynara.example/v1/risk/assess",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
json={
"payment": "pay_3NqL8k"
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"id": "ra_7Hk3Lm",
"object": "risk_assessment",
"payment": "pay_3NqL8k",
"score": 12,
"decision": "allow",
"base": 18,
"reasons": [
{
"code": "three_ds_passed",
"label": "ผ่าน 3-D Secure แล้ว",
"points": -6
}
],
"signals": {
"amount_ratio": 1.2,
"ip_country_mismatch": 0,
"velocity_1h": 1,
"card_age_days": 210,
"email_new": 0,
"three_ds_passed": 1,
"address_mismatch": 0,
"ip_country": "TH",
"card_country": "TH"
},
"thresholds": {
"review": 40,
"block": 70
},
"model_version": "risk-2026.09",
"created": "2026-10-12T10:14:31+07:00",
"livemode": false
}{
"error": {
"code": "parameter_missing",
"message": "ขาดฟิลด์ที่จำเป็น",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#parameter_missing"
}
}{
"error": {
"code": "resource_not_found",
"message": "ไม่พบรายการ",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#resource_not_found"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}แจ้งผลจริงของรายการBeta
POST/v1/risk/assessments/{assessment_id}/feedback
บอกระบบว่ารายการที่ประเมินแล้วเป็นของจริงหรือทุจริต — ช่วยปรับเกณฑ์เฉพาะร้านให้แม่นขึ้น
Path parameterspath
assessment_idstringจำเป็นรหัสผลประเมิน
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
Request bodyapplication/json
outcomestringจำเป็นผลจริง
notestringไม่บังคับเหตุผล
ผลลัพธ์
- 200บันทึกแล้ว
- 400
parameter_invalidค่าฟิลด์ไม่ถูกต้อง - 404
resource_not_foundไม่พบรายการ - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- แจ้งผลจริง (fraudulent / legitimate) ช่วยให้คะแนนความเสี่ยงของร้านแม่นขึ้นในรายการถัดไป
- ไม่เปลี่ยนสถานะ payment — ถ้าเป็นการโกงจริงให้คืนเงินหรือยกเลิกเอง
curl -X POST "https://sandbox.api.paynara.example/v1/risk/assessments/ra_7Jm6Np/feedback" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Content-Type: application/json" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub" \
-d '{
"outcome": "fraudulent",
"note": "โทรตามเบอร์ไม่ติด ชื่อผู้รับไม่ตรงกับบัตร"
}'const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/risk/assessments/ra_7Jm6Np/feedback', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
body: JSON.stringify({
"outcome": "fraudulent",
"note": "โทรตามเบอร์ไม่ติด ชื่อผู้รับไม่ตรงกับบัตร"
}),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.post(
"https://sandbox.api.paynara.example/v1/risk/assessments/ra_7Jm6Np/feedback",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
json={
"outcome": "fraudulent",
"note": "โทรตามเบอร์ไม่ติด ชื่อผู้รับไม่ตรงกับบัตร"
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"id": "ra_7Jm6Np",
"object": "risk_assessment",
"feedback": {
"outcome": "fraudulent",
"note": "โทรตามเบอร์ไม่ติด ชื่อผู้รับไม่ตรงกับบัตร",
"at": "2026-10-12T10:58:40+07:00"
}
}{
"error": {
"code": "parameter_invalid",
"message": "ค่าฟิลด์ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#parameter_invalid"
}
}{
"error": {
"code": "resource_not_found",
"message": "ไม่พบรายการ",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#resource_not_found"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}ตรวจข้อมูลบัตรจาก BIN
ดูเครือข่าย ประเภท (เครดิต/เดบิต/เติมเงิน) ประเทศ และธนาคารผู้ออกบัตรจากเลข 6–8 หลักแรก — ใช้ตัดสินใจเสนอผ่อนชำระหรือแจ้งค่าธรรมเนียมบัตรต่างประเทศก่อนลูกค้ายืนยัน
Path parameterspath
binstringจำเป็นเลข 6–8 หลักแรกของบัตร
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
ผลลัพธ์
- 200บัตรทดสอบในประเทศ (ข้อมูลสมมติ)
- 404
bin_not_foundไม่พบข้อมูล BIN - 400
parameter_invalidค่าฟิลด์ไม่ถูกต้อง - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- ข้อมูล BIN ในเอกสารนี้เป็นตัวอย่างสมมติ ไม่ตรงกับบัตรจริง
- ส่งได้เฉพาะ BIN — ห้ามส่งเลขบัตรเต็มเข้าระบบร้าน
curl -X GET "https://sandbox.api.paynara.example/v1/bins/400000" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub"const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/bins/400000', {
method: 'GET',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.get(
"https://sandbox.api.paynara.example/v1/bins/400000",
headers={
"Authorization": f"Bearer {API_KEY}",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"object": "bin",
"bin": "400000",
"brand": "visa",
"type": "credit",
"level": "classic",
"country": "TH",
"issuer": "ธนาคารสยามรุ่ง (สมมติ)",
"three_d_secure": true,
"note": "บัตรทดสอบ sandbox (ในประเทศ)",
"installment_eligible": true,
"fee_key": "card",
"livemode": false
}{
"error": {
"code": "bin_not_found",
"message": "ไม่พบข้อมูล BIN",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#bin_not_found"
}
}{
"error": {
"code": "parameter_invalid",
"message": "ค่าฟิลด์ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#parameter_invalid"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}ตรวจบัญชีธนาคาร
ตรวจว่าบัญชีมีอยู่และชื่อเจ้าของตรงกับที่คาด (ไม่โอนเงินทดสอบ) — ใช้ก่อนเปลี่ยนบัญชีรับเงินของร้าน หรือก่อนคืนเงินไปบัญชีที่ลูกค้าแจ้ง
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Idempotency-Keystring · uuidจำเป็นกันรายการซ้ำเมื่อส่งซ้ำ (เช่น เน็ตหลุด) — ใช้ค่าเดิมได้ภายใน 24 ชม.
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
Request bodyapplication/json
bankstringจำเป็นรหัสธนาคาร (สมมติ)
account_numberstringจำเป็นเลขบัญชี 10–12 หลัก
expected_namestringไม่บังคับชื่อที่คาด (ตรวจแบบคลุมเครือ รองรับคำนำหน้า/เว้นวรรค)
purposestringไม่บังคับใช้ทำอะไร
ผลลัพธ์
- 200บัญชีใช้ได้ ชื่อตรง
- 422
bank_account_name_mismatchชื่อบัญชีไม่ตรงกับร้าน - 400
parameter_invalidค่าฟิลด์ไม่ถูกต้อง - 503
service_unavailableปิดปรับปรุงหรือเครือข่ายปลายทางไม่ตอบ - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- id ของบัญชีที่ตรวจแล้ว (ba_…) ใช้ได้ 7 วัน
- เลขบัญชีไม่ถูกส่งกลับ — ตอบเฉพาะ 4 หลักท้ายและชื่อแบบปิดบัง (PDPA)
curl -X POST "https://sandbox.api.paynara.example/v1/bank-accounts/verify" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub" \
-d '{
"bank": "rkh",
"account_number": "0123456789",
"expected_name": "ศิริ***",
"purpose": "refund_destination"
}'const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/bank-accounts/verify', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': '7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f',
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
body: JSON.stringify({
"bank": "rkh",
"account_number": "0123456789",
"expected_name": "ศิริ***",
"purpose": "refund_destination"
}),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.post(
"https://sandbox.api.paynara.example/v1/bank-accounts/verify",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"Idempotency-Key": "7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
json={
"bank": "rkh",
"account_number": "0123456789",
"expected_name": "ศิริ***",
"purpose": "refund_destination"
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"id": "ba_6Qw1Rt",
"object": "bank_account",
"status": "verified",
"bank": "rkh",
"bank_name": "ธนาคารรวงข้าว (สมมติ)",
"account_last4": "6789",
"account_name": "ศิริ*** ม***",
"name_match": "match",
"purpose": "refund_destination",
"expires_at": "2026-09-21T09:02:11+07:00",
"created": "2026-09-14T09:02:11+07:00",
"livemode": false
}{
"error": {
"code": "bank_account_name_mismatch",
"message": "ชื่อบัญชีไม่ตรงกับร้าน",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#bank_account_name_mismatch"
}
}{
"error": {
"code": "parameter_invalid",
"message": "ค่าฟิลด์ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#parameter_invalid"
}
}{
"error": {
"code": "service_unavailable",
"message": "ปิดปรับปรุงหรือเครือข่ายปลายทางไม่ตอบ",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#service_unavailable"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}ตรวจสลิปโอนเงิน
อ่านค่าจากสลิปโอนเงินที่ลูกค้าส่งมา (ยอด เวลา ผู้โอน ผู้รับ เลขอ้างอิง) แล้วตรวจกับระบบธนาคารว่ามีรายการจริง โอนเข้าบัญชีร้าน และยังไม่เคยถูกใช้ — สำหรับร้านที่ยังรับโอนตรงนอกระบบ
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Idempotency-Keystring · uuidจำเป็นกันรายการซ้ำเมื่อส่งซ้ำ (เช่น เน็ตหลุด) — ใช้ค่าเดิมได้ภายใน 24 ชม.
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
Request bodyapplication/json
filestringไม่บังคับไฟล์สลิป (POST /v1/files purpose = slip)
qr_payloadstringไม่บังคับข้อความจาก QR ตรวจสอบบนสลิป (อ่านเองได้ แทนการส่งไฟล์)
expected_amountintegerไม่บังคับยอดที่ควรได้ (สตางค์) — ไม่ตรงจะได้ amount_match = false
order_refstringไม่บังคับผูกสลิปกับคำสั่งซื้อ (กันใช้ซ้ำ)
ผลลัพธ์
- 200สลิปจริง ยอดตรง โอนเข้าบัญชีร้าน
- 422
slip_unreadableอ่านสลิปไม่ได้ - 409
slip_duplicateสลิปนี้ถูกใช้แล้ว - 400
file_invalidไฟล์ไม่ถูกต้อง - 503
service_unavailableปิดปรับปรุงหรือเครือข่ายปลายทางไม่ตอบ - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- ส่ง file หรือ qr_payload อย่างใดอย่างหนึ่ง
- สลิปที่ผ่านแล้วผูกกับ order_ref — ใช้กับคำสั่งซื้ออื่นจะได้ 409 slip_duplicate พร้อม duplicate_of
curl -X POST "https://sandbox.api.paynara.example/v1/slips/verify" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub" \
-d '{
"file": "file_8Hj2Gh",
"expected_amount": 42000,
"order_ref": "ORD-2610-0156"
}'const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/slips/verify', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': '7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f',
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
body: JSON.stringify({
"file": "file_8Hj2Gh",
"expected_amount": 42000,
"order_ref": "ORD-2610-0156"
}),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.post(
"https://sandbox.api.paynara.example/v1/slips/verify",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"Idempotency-Key": "7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
json={
"file": "file_8Hj2Gh",
"expected_amount": 42000,
"order_ref": "ORD-2610-0156"
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"id": "slip_8Hj3Ka",
"object": "slip_verification",
"status": "verified",
"file": "file_8Hj2Gh",
"transaction_ref": "2026101209312245SRR07714",
"amount": 42000,
"currency": "THB",
"transferred_at": "2026-10-12T09:31:22+07:00",
"sender": {
"name": "นาย ธ*** ส***",
"bank": "fsi",
"account_masked": "xxx-x-x7731-x",
"bank_name": "ธนาคารฟ้าใส (สมมติ)"
},
"receiver": {
"name": "ปลื้มจิต ใจ***",
"bank": "srr",
"account_masked": "xxx-x-x4821-x",
"bank_name": "ธนาคารสยามรุ่ง (สมมติ)",
"matches_merchant": true
},
"expected_amount": 42000,
"amount_match": true,
"order_ref": "ORD-2610-0156",
"duplicate_of": null,
"created": "2026-10-12T09:33:05+07:00",
"livemode": false
}{
"error": {
"code": "slip_unreadable",
"message": "อ่านสลิปไม่ได้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#slip_unreadable"
}
}{
"error": {
"code": "slip_duplicate",
"message": "สลิปนี้ถูกใช้แล้ว",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#slip_duplicate"
}
}{
"error": {
"code": "file_invalid",
"message": "ไฟล์ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#file_invalid"
}
}{
"error": {
"code": "service_unavailable",
"message": "ปิดปรับปรุงหรือเครือข่ายปลายทางไม่ตอบ",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#service_unavailable"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}รายการข้อพิพาท (chargeback)
ข้อพิพาทที่ผู้ถือบัตรแจ้งธนาคาร — ยอดถูกระงับทันที ร้านต้องส่งหลักฐานก่อน evidence_due_by
Query parametersquery
limitintegerไม่บังคับจำนวนรายการต่อหน้า
starting_afterstringไม่บังคับcursor — id ของรายการสุดท้ายในหน้าก่อน (ไปหน้าถัดไป)
ending_beforestringไม่บังคับcursor — id ของรายการแรกในหน้าปัจจุบัน (ย้อนกลับ) · ห้ามส่งพร้อม starting_after
statusstringไม่บังคับสถานะ
paymentstringไม่บังคับเฉพาะ payment นี้
created[gte]string · date-timeไม่บังคับสร้างตั้งแต่เวลา (ISO 8601 +07:00) · ช่วงรวมไม่เกิน 92 วัน
created[lte]string · date-timeไม่บังคับสร้างถึงเวลา
sortstringไม่บังคับเรียงลำดับ (ใส่ - ข้างหน้า = มากไปน้อย)
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
ผลลัพธ์
- 200ข้อพิพาทที่ต้องตอบ
- 400
cursor_invalidcursor ของการแบ่งหน้าไม่ถูกต้อง - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- เรียงตาม evidence_due_by ใกล้สุดก่อนเพื่อไม่ให้พลาดกำหนด (ไม่ตอบ = แพ้อัตโนมัติ)
- ยอดข้อพิพาท + ค่าดำเนินการถูกระงับใน balance.reserved จนกว่าจะปิดเรื่อง
curl -X GET "https://sandbox.api.paynara.example/v1/disputes?limit=20&status=needs_response" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub"const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/disputes?limit=20&status=needs_response', {
method: 'GET',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.get(
"https://sandbox.api.paynara.example/v1/disputes?limit=20&status=needs_response",
headers={
"Authorization": f"Bearer {API_KEY}",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"object": "list",
"url": "/v1/disputes",
"has_more": false,
"data": [
{
"id": "dsp_6Bn2Lw",
"object": "dispute",
"payment": "pay_1Aa9Cc",
"order_ref": "ORD-2609-0388",
"amount": 38000,
"currency": "THB",
"reason": "product_not_received",
"network_reason_code": "13.1",
"status": "needs_response",
"evidence_due_by": "2026-10-20T23:59:59+07:00",
"evidence": {
"product_description": null,
"shipping_documentation": null,
"delivery_proof": null,
"customer_communication": null,
"notes": null
},
"evidence_submitted_at": null,
"fee": 15000,
"balance_transactions": [
"txn_DSP6Bn2",
"txn_ADJ8Ws2"
],
"card": {
"brand": "visa",
"last4": "0002"
},
"created": "2026-10-08T16:20:00+07:00",
"closed_at": null,
"livemode": false
}
],
"next_cursor": null
}{
"error": {
"code": "cursor_invalid",
"message": "cursor ของการแบ่งหน้าไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#cursor_invalid"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}ดูข้อพิพาท
รายละเอียด เหตุผล กำหนดส่ง และหลักฐานที่ส่งแล้ว
Path parameterspath
dispute_idstringจำเป็นรหัสข้อพิพาท
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
ผลลัพธ์
- 200รอร้านส่งหลักฐาน
- 404
resource_not_foundไม่พบรายการ - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- network_reason_code เป็นรหัสของเครือข่ายบัตร — ดูคำอธิบายไทยใน reason
- ชนะข้อพิพาท: ได้ยอดและค่าดำเนินการคืนผ่าน transaction ชนิด dispute_reversal
curl -X GET "https://sandbox.api.paynara.example/v1/disputes/dsp_6Bn2Lw" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub"const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/disputes/dsp_6Bn2Lw', {
method: 'GET',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.get(
"https://sandbox.api.paynara.example/v1/disputes/dsp_6Bn2Lw",
headers={
"Authorization": f"Bearer {API_KEY}",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"id": "dsp_6Bn2Lw",
"object": "dispute",
"payment": "pay_1Aa9Cc",
"order_ref": "ORD-2609-0388",
"amount": 38000,
"currency": "THB",
"reason": "product_not_received",
"network_reason_code": "13.1",
"status": "needs_response",
"evidence_due_by": "2026-10-20T23:59:59+07:00",
"evidence": {
"product_description": null,
"shipping_documentation": null,
"delivery_proof": null,
"customer_communication": null,
"notes": null
},
"evidence_submitted_at": null,
"fee": 15000,
"balance_transactions": [
"txn_DSP6Bn2",
"txn_ADJ8Ws2"
],
"card": {
"brand": "visa",
"last4": "0002"
},
"created": "2026-10-08T16:20:00+07:00",
"closed_at": null,
"livemode": false
}{
"error": {
"code": "resource_not_found",
"message": "ไม่พบรายการ",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#resource_not_found"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}ส่งหลักฐานข้อพิพาท
POST/v1/disputes/{dispute_id}/evidence
ส่งหลักฐาน (ส่งได้ครั้งเดียว — ใช้ submit: false เพื่อบันทึกร่างก่อน) · หลังส่ง status เป็น under_review ผลภายใน 30–75 วัน
Path parameterspath
dispute_idstringจำเป็นรหัสข้อพิพาท
Headersheader
X-Merchant-Idstringจำเป็นรหัสร้านค้าที่ทำรายการ (บัญชี platform ใช้สลับร้าน · บัญชีร้านเดียวส่งค่าของตัวเอง)
Idempotency-Keystring · uuidจำเป็นกันรายการซ้ำเมื่อส่งซ้ำ (เช่น เน็ตหลุด) — ใช้ค่าเดิมได้ภายใน 24 ชม.
Paynara-Versionstringไม่บังคับเวอร์ชัน API (ไม่ส่ง = เวอร์ชันที่ผูกกับ key)
Request bodyapplication/json
product_descriptionstringไม่บังคับรายละเอียดสินค้า
shipping_documentationstringไม่บังคับไฟล์ใบส่งของ (file_…)
delivery_proofstringไม่บังคับไฟล์หลักฐานส่งถึง เช่น ภาพถ่าย/ลายเซ็น (file_…)
customer_communicationstringไม่บังคับไฟล์ข้อความคุยกับลูกค้า (file_…)
notesstringไม่บังคับคำชี้แจง (≤ 2,000 ตัว)
submitbooleanไม่บังคับส่งจริง (false = บันทึกร่าง)
ผลลัพธ์
- 200ส่งแล้ว รอธนาคารพิจารณา
- 409
dispute_closedข้อพิพาทปิดแล้ว - 400
file_invalidไฟล์ไม่ถูกต้อง - 400
parameter_invalidค่าฟิลด์ไม่ถูกต้อง - 401
authentication_failedAPI key ไม่ถูกต้อง - 403
insufficient_scopekey ไม่มีสิทธิ์ (scope) ที่ต้องใช้ - 429
rate_limitedเรียกเกินโควตา
- ส่งหลักฐานได้ครั้งเดียว (submit = true) — ก่อนนั้นบันทึกร่างได้หลายครั้ง
- ไฟล์อัปโหลดผ่าน POST /v1/files (purpose = dispute_evidence) แล้วอ้าง id
curl -X POST "https://sandbox.api.paynara.example/v1/disputes/dsp_6Bn2Lw/evidence" \
-H "Authorization: Bearer pn_test_8Qm4ZsT2vXa9Lr" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f" \
-H "Paynara-Version: 2026-08-01" \
-H "X-Merchant-Id: mch_baanmaeplub" \
-d '{
"product_description": "กล่องรวมทองหยิบ ทองหยอด ฝอยทอง 1 กล่อง + ส่งแช่เย็น",
"shipping_documentation": "file_3Kx1Aa",
"delivery_proof": "file_3Ly4Bb",
"customer_communication": "file_3Mz7Cc",
"notes": "ส่งถึง 24 ก.ย. 15:42 ผู้รับลงชื่อรับ ภาพถ่ายหน้าประตูตามที่อยู่",
"submit": true
}'const API_KEY = process.env.API_KEY; // pn_test_8Qm4ZsT2vXa9Lr
const res = await fetch('https://sandbox.api.paynara.example/v1/disputes/dsp_6Bn2Lw/evidence', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': '7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f',
'Paynara-Version': '2026-08-01',
'X-Merchant-Id': 'mch_baanmaeplub',
},
body: JSON.stringify({
"product_description": "กล่องรวมทองหยิบ ทองหยอด ฝอยทอง 1 กล่อง + ส่งแช่เย็น",
"shipping_documentation": "file_3Kx1Aa",
"delivery_proof": "file_3Ly4Bb",
"customer_communication": "file_3Mz7Cc",
"notes": "ส่งถึง 24 ก.ย. 15:42 ผู้รับลงชื่อรับ ภาพถ่ายหน้าประตูตามที่อยู่",
"submit": true
}),
});
if (!res.ok) throw new Error((await res.json()).error.code);
const data = await res.json();
console.log(data);import os
import requests
API_KEY = os.environ["API_KEY"] # pn_test_8Qm4ZsT2vXa9Lr
res = requests.post(
"https://sandbox.api.paynara.example/v1/disputes/dsp_6Bn2Lw/evidence",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"Idempotency-Key": "7f3c9a2e-1b4d-4c8e-9f60-2a5d8e1c4b7f",
"Paynara-Version": "2026-08-01",
"X-Merchant-Id": "mch_baanmaeplub",
},
json={
"product_description": "กล่องรวมทองหยิบ ทองหยอด ฝอยทอง 1 กล่อง + ส่งแช่เย็น",
"shipping_documentation": "file_3Kx1Aa",
"delivery_proof": "file_3Ly4Bb",
"customer_communication": "file_3Mz7Cc",
"notes": "ส่งถึง 24 ก.ย. 15:42 ผู้รับลงชื่อรับ ภาพถ่ายหน้าประตูตามที่อยู่",
"submit": True
},
timeout=10,
)
res.raise_for_status()
print(res.json()){
"id": "dsp_6Bn2Lw",
"object": "dispute",
"payment": "pay_1Aa9Cc",
"order_ref": "ORD-2609-0388",
"amount": 38000,
"currency": "THB",
"reason": "product_not_received",
"network_reason_code": "13.1",
"status": "under_review",
"evidence_due_by": "2026-10-20T23:59:59+07:00",
"evidence": {
"product_description": "กล่องรวมทองหยิบ ทองหยอด ฝอยทอง 1 กล่อง + ส่งแช่เย็น",
"shipping_documentation": "file_3Kx1Aa",
"delivery_proof": "file_3Ly4Bb",
"customer_communication": "file_3Mz7Cc",
"notes": "ส่งถึง 24 ก.ย. 15:42 ผู้รับลงชื่อรับ"
},
"evidence_submitted_at": "2026-10-12T10:20:00+07:00",
"fee": 15000,
"balance_transactions": [
"txn_DSP6Bn2",
"txn_ADJ8Ws2"
],
"card": {
"brand": "visa",
"last4": "0002"
},
"created": "2026-10-08T16:20:00+07:00",
"closed_at": null,
"livemode": false
}{
"error": {
"code": "dispute_closed",
"message": "ข้อพิพาทปิดแล้ว",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#dispute_closed"
}
}{
"error": {
"code": "file_invalid",
"message": "ไฟล์ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#file_invalid"
}
}{
"error": {
"code": "parameter_invalid",
"message": "ค่าฟิลด์ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#parameter_invalid"
}
}{
"error": {
"code": "authentication_failed",
"message": "API key ไม่ถูกต้อง",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#authentication_failed"
}
}{
"error": {
"code": "insufficient_scope",
"message": "key ไม่มีสิทธิ์ (scope) ที่ต้องใช้",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#insufficient_scope"
}
}{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#rate_limited"
}
}Webhooks — แจ้งเหตุการณ์ไปที่ระบบของคุณ
ลงทะเบียน URL ปลายทาง แล้วระบบจะส่ง POST พร้อม JSON ทุกครั้งที่เกิดเหตุการณ์ด้านล่าง · ตอบกลับ 2xx ภายใน 10 วินาที ไม่งั้นจะส่งซ้ำตามตาราง · ทุกคำขอมีหัว Paynara-Signature ให้ตรวจว่ามาจากเราจริง · event อาจมาซ้ำหรือสลับลำดับ ให้ใช้ id กันประมวลผลซ้ำ
merchant.verification.requires_inputต้องส่งข้อมูล/เอกสารเพิ่ม
ส่งเมื่อ: เอกสารไม่ผ่านหรือข้อมูลไม่ครบ (ดู requirements)
{
"id": "evt_01JB7Q00",
"type": "merchant.verification.requires_input",
"created": "2026-10-12T10:00:00+07:00",
"livemode": false,
"data": {
"id": "vrf_K8m2Tq",
"object": "merchant_verification",
"merchant": "mch_baanmaeplub",
"type": "individual",
"status": "requires_input",
"business": {
"name": "ร้านขนมบ้านแม่ปลื้ม",
"name_en": "Baan Mae Pluem Desserts",
"mcc": "5441",
"mcc_label": "ร้านขนม/ลูกกวาด",
"website": "https://baanmaeplub.example",
"phone": "08x-xxx-0141",
"address": {
"line1": "88/12 ซอยประชาอุทิศ 33 (สมมติ)",
"district": "ทุ่งครุ",
"province": "กรุงเทพมหานคร",
"postal_code": "10140"
}
},
"representative": {
"name": "ปลื้มจิต ใจ***",
"id_number": "1-1037-xxxxx-xx-4",
"nationality": "TH"
},
"documents": [
{
"type": "id_card",
"file": "file_2Ab9Cd",
"status": "accepted"
},
{
"type": "commercial_registration",
"file": "file_2Bc4De",
"status": "rejected",
"rejection_reason": "image_blurry"
},
{
"type": "bank_book",
"file": "file_2De1Fg",
"status": "accepted"
}
],
"bank_account": {
"bank": "srr",
"bank_name": "ธนาคารสยามรุ่ง (สมมติ)",
"account_last4": "4821",
"name_match": "pending"
},
"requirements": {
"currently_due": [
"documents.commercial_registration"
],
"due_by": "2026-03-27T23:59:59+07:00",
"errors": [
{
"field": "documents.commercial_registration",
"code": "image_blurry",
"message": "ภาพเบลอ อ่านเลขทะเบียนไม่ได้ กรุณาสแกนใหม่ 200 dpi"
}
]
},
"capabilities": {
"card_payments": "inactive",
"promptpay": "inactive",
"installment": "inactive",
"payouts": "inactive"
},
"submitted_at": "2026-03-18T16:20:44+07:00",
"verified_at": null,
"created": "2026-03-18T16:20:44+07:00",
"livemode": true
}
}merchant.verification.verifiedผ่าน KYB
ส่งเมื่อ: ตรวจครบทุกเอกสาร — live key ใช้รับเงินได้
{
"id": "evt_01JB7Q01",
"type": "merchant.verification.verified",
"created": "2026-10-12T10:00:00+07:00",
"livemode": false,
"data": {
"id": "vrf_K8m2Tq",
"object": "merchant_verification",
"merchant": "mch_baanmaeplub",
"type": "individual",
"status": "verified",
"business": {
"name": "ร้านขนมบ้านแม่ปลื้ม",
"name_en": "Baan Mae Pluem Desserts",
"mcc": "5441",
"mcc_label": "ร้านขนม/ลูกกวาด",
"website": "https://baanmaeplub.example",
"phone": "08x-xxx-0141",
"address": {
"line1": "88/12 ซอยประชาอุทิศ 33 (สมมติ)",
"district": "ทุ่งครุ",
"province": "กรุงเทพมหานคร",
"postal_code": "10140"
}
},
"representative": {
"name": "ปลื้มจิต ใจ***",
"id_number": "1-1037-xxxxx-xx-4",
"nationality": "TH"
},
"documents": [
{
"type": "id_card",
"file": "file_2Ab9Cd",
"status": "accepted"
},
{
"type": "commercial_registration",
"file": "file_2Cd7Ef",
"status": "accepted"
},
{
"type": "bank_book",
"file": "file_2De1Fg",
"status": "accepted"
}
],
"bank_account": {
"bank": "srr",
"bank_name": "ธนาคารสยามรุ่ง (สมมติ)",
"account_last4": "4821",
"name_match": "match"
},
"requirements": {
"currently_due": [],
"due_by": null,
"errors": []
},
"capabilities": {
"card_payments": "active",
"promptpay": "active",
"installment": "active",
"payouts": "active"
},
"submitted_at": "2026-03-18T16:20:44+07:00",
"verified_at": "2026-03-20T15:42:10+07:00",
"created": "2026-03-18T16:20:44+07:00",
"livemode": true
}
}merchant.verification.rejectedไม่ผ่าน KYB
ส่งเมื่อ: ธุรกิจไม่อยู่ในประเภทที่รับ หรือไม่ส่งเพิ่มภายในกำหนด
{
"id": "evt_01JB7Q02",
"type": "merchant.verification.rejected",
"created": "2026-10-12T10:00:00+07:00",
"livemode": false,
"data": {
"id": "vrf_J2a7Qp",
"object": "merchant_verification",
"merchant": "mch_example2",
"status": "rejected",
"rejection_reason": "requirements_past_due"
}
}risk.review_requiredรายการถูกพักตรวจ
ส่งเมื่อ: คะแนน 40–69 (payment เป็น requires_capture รอร้านตัดสิน 7 วัน)
{
"id": "evt_01JB7Q03",
"type": "risk.review_required",
"created": "2026-10-12T10:00:00+07:00",
"livemode": false,
"data": {
"id": "ra_7Jm6Np",
"object": "risk_assessment",
"payment": "pay_3Xy5Kd",
"score": 66,
"decision": "review",
"base": 18,
"reasons": [
{
"code": "amount_ratio",
"label": "ยอดเทียบค่าเฉลี่ยของลูกค้าคนนี้",
"points": 16
},
{
"code": "ip_country_mismatch",
"label": "IP อยู่ต่างประเทศ (ไม่ตรงประเทศบัตร)",
"points": 18
},
{
"code": "card_age_days",
"label": "บัตรนี้เคยใช้กับร้าน (วัน)",
"points": 14
},
{
"code": "three_ds_passed",
"label": "ผ่าน 3-D Secure แล้ว",
"points": -6
},
{
"code": "address_mismatch",
"label": "ที่อยู่จัดส่งต่างจังหวัดกับที่อยู่บิล",
"points": 6
}
],
"signals": {
"amount_ratio": 5,
"ip_country_mismatch": 1,
"velocity_1h": 2,
"card_age_days": 0,
"email_new": 0,
"three_ds_passed": 1,
"address_mismatch": 1,
"ip_country": "NL",
"card_country": "SG"
},
"thresholds": {
"review": 40,
"block": 70
},
"model_version": "risk-2026.09",
"created": "2026-10-12T10:38:21+07:00",
"livemode": false
}
}dispute.createdมีข้อพิพาทใหม่
ส่งเมื่อ: ผู้ถือบัตรแจ้งธนาคาร — ยอดถูกระงับทันที
{
"id": "evt_01JB7Q04",
"type": "dispute.created",
"created": "2026-10-12T10:00:00+07:00",
"livemode": false,
"data": {
"id": "dsp_6Bn2Lw",
"object": "dispute",
"payment": "pay_1Aa9Cc",
"order_ref": "ORD-2609-0388",
"amount": 38000,
"currency": "THB",
"reason": "product_not_received",
"network_reason_code": "13.1",
"status": "needs_response",
"evidence_due_by": "2026-10-20T23:59:59+07:00",
"evidence": {
"product_description": null,
"shipping_documentation": null,
"delivery_proof": null,
"customer_communication": null,
"notes": null
},
"evidence_submitted_at": null,
"fee": 15000,
"balance_transactions": [
"txn_DSP6Bn2",
"txn_ADJ8Ws2"
],
"card": {
"brand": "visa",
"last4": "0002"
},
"created": "2026-10-08T16:20:00+07:00",
"closed_at": null,
"livemode": false
}
}dispute.evidence_due_soonใกล้ครบกำหนดส่งหลักฐาน
ส่งเมื่อ: 3 วันก่อน evidence_due_by ถ้ายังไม่ส่ง
{
"id": "evt_01JB7Q05",
"type": "dispute.evidence_due_soon",
"created": "2026-10-12T10:00:00+07:00",
"livemode": false,
"data": {
"id": "dsp_6Bn2Lw",
"object": "dispute",
"status": "needs_response",
"evidence_due_by": "2026-10-20T23:59:59+07:00"
}
}dispute.closedข้อพิพาทสิ้นสุด
ส่งเมื่อ: ธนาคารตัดสิน (won = คืนยอด + ค่าดำเนินการ · lost = เสียยอด)
{
"id": "evt_01JB7Q06",
"type": "dispute.closed",
"created": "2026-10-12T10:00:00+07:00",
"livemode": false,
"data": {
"id": "dsp_5Ak8Jv",
"object": "dispute",
"status": "won",
"amount": 42000,
"closed_at": "2026-09-02T11:20:00+07:00"
}
}slip.duplicate_detectedพบสลิปใช้ซ้ำ
ส่งเมื่อ: มีการตรวจสลิปที่เคยผ่านแล้วกับคำสั่งซื้ออื่น
{
"id": "evt_01JB7Q07",
"type": "slip.duplicate_detected",
"created": "2026-10-12T10:00:00+07:00",
"livemode": false,
"data": {
"id": "slip_8Kl9Ma",
"object": "slip_verification",
"status": "duplicate",
"duplicate_of": "slip_8Hj3Ka",
"order_ref": "ORD-2610-0163",
"amount": 42000
}
}ส่งซ้ำเมื่อปลายทางไม่ตอบ
- 1ทันที
- 21 นาที
- 35 นาที
- 430 นาที
- 52 ชั่วโมง
- 66 ชั่วโมง
- 724 ชั่วโมง (ครั้งสุดท้าย)
ครบทุกครั้งแล้วยังล้มเหลว → ปิด endpoint อัตโนมัติและส่งอีเมลแจ้งผู้ดูแล · ดูประวัติการส่งและกดส่งซ้ำได้ในแดชบอร์ด
ตรวจลายเซ็น
# ลายเซ็นอยู่ในหัว Paynara-Signature: t=<unix>,v1=<hex>
# คำนวณ HMAC-SHA256(secret, "<t>.<raw body>") แล้วเทียบกับ v1
printf '%s' "$T.$BODY" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET"import crypto from 'node:crypto';
// ใช้ raw body (ยังไม่ parse JSON) เท่านั้น
export function verify(rawBody, sigHeader, secret) {
const parts = Object.fromEntries(sigHeader.split(',').map((p) => p.split('=')));
const age = Math.abs(Date.now() / 1000 - Number(parts.t));
if (age > 300) return false; // เก่ากว่า 5 นาที = ปฏิเสธ (กัน replay)
const expected = crypto.createHmac('sha256', secret).update(parts.t + '.' + rawBody).digest('hex');
return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}import hmac, hashlib, time
def verify(raw_body: bytes, sig_header: str, secret: str) -> bool:
parts = dict(p.split("=", 1) for p in sig_header.split(","))
if abs(time.time() - int(parts["t"])) > 300:
return False # เก่ากว่า 5 นาที = ปฏิเสธ (กัน replay)
msg = parts["t"].encode() + b"." + raw_body
expected = hmac.new(secret.encode(), msg, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts["v1"])Errors — รหัสข้อผิดพลาด
ทุก error ตอบกลับเป็น JSON รูปแบบเดียวกัน พร้อม request_id สำหรับแจ้งทีมสนับสนุน · รหัส HTTP บอกกลุ่มของปัญหา ส่วน error.code บอกสาเหตุที่แน่นอน (ใช้เขียนเงื่อนไขในโค้ดได้ เพราะไม่เปลี่ยนตามภาษา)
- 4xx คำขอไม่ถูกต้อง — แก้ที่ฝั่งผู้เรียก ส่งซ้ำแบบเดิมจะได้ผลเดิม
- 5xx ปัญหาฝั่งระบบ — ลองใหม่แบบเว้นระยะ (exponential backoff) พร้อม Idempotency-Key
{
"error": {
"code": "verification_in_progress",
"message": "มีคำขอตรวจสอบค้างอยู่",
"param": "items[0].quantity",
"request_id": "req_8Fq2LmX0",
"doc_url": "https://docs.paynara.example/errors#verification_in_progress"
}
}| HTTP | code | ความหมาย | วิธีแก้ |
|---|---|---|---|
| 409 | verification_in_progress | มีคำขอตรวจสอบค้างอยู่ ร้านมี verification ที่ status = pending อยู่แล้ว | รอผล หรือส่งเอกสารเพิ่มใน verification เดิม |
| 403 | merchant_not_verified | ร้านค้ายังไม่ผ่าน KYB ร้านที่ยังไม่ผ่านการยืนยันตัวตนใช้ live key รับเงินจริงไม่ได้ | ส่งเอกสาร KYB ให้ครบ (ดูหน้า Verification) แล้วรอผล |
| 400 | file_invalid | ไฟล์ไม่ถูกต้อง รองรับ PDF JPG PNG · purpose ไม่ตรงกับชนิดเอกสาร | ตรวจชนิดไฟล์และ purpose |
| 413 | file_too_large | ไฟล์ใหญ่เกิน ไฟล์ต้องไม่เกิน 10 MB | บีบอัดหรือสแกนที่ 200 dpi |
| 422 | bank_account_name_mismatch | ชื่อบัญชีไม่ตรงกับร้าน ชื่อเจ้าของบัญชีจากธนาคารไม่ตรงกับชื่อร้าน/ผู้ประกอบการที่ยืนยันแล้ว | ใช้บัญชีชื่อเดียวกับผู้ประกอบการ หรือส่งหนังสือยินยอม |
| 404 | bin_not_found | ไม่พบข้อมูล BIN เลข 6–8 หลักแรกของบัตรไม่อยู่ในฐานข้อมูล | ตรวจเลข BIN · ถ้าเป็นบัตรใหม่ ระบบยังรับชำระได้ตามปกติ |
| 422 | slip_unreadable | อ่านสลิปไม่ได้ ภาพเบลอ ถูกครอป หรือไม่มี QR ตรวจสอบบนสลิป | ขอสลิปต้นฉบับจากแอปธนาคาร (ไม่ใช่ภาพถ่ายหน้าจอซ้อน) |
| 409 | slip_duplicate | สลิปนี้ถูกใช้แล้ว เลขอ้างอิงธุรกรรมเคยตรวจผ่านกับคำสั่งซื้ออื่นแล้ว | อย่าส่งของ · ติดต่อลูกค้า (อาจเป็นการใช้สลิปซ้ำ) |
| 409 | dispute_closed | ข้อพิพาทปิดแล้ว ส่งหลักฐานหลังกำหนด (evidence_due_by) หรือข้อพิพาทตัดสินแล้ว | ส่งหลักฐานก่อนกำหนด · ดู dispute.status |
| 400 | parameter_missing | ขาดฟิลด์ที่จำเป็น ไม่ได้ส่งฟิลด์ที่ทำเครื่องหมาย "จำเป็น" (ชื่อฟิลด์อยู่ใน error.param) | เพิ่มฟิลด์ตาม error.param แล้วส่งใหม่ |
| 400 | parameter_invalid | ค่าฟิลด์ไม่ถูกต้อง ชนิดข้อมูล รูปแบบ หรือค่าที่ไม่อยู่ใน enum เช่น amount เป็นทศนิยม หรือวันที่ไม่ใช่ ISO 8601 | เงินส่งเป็นสตางค์ (จำนวนเต็ม) · เวลาใช้ ISO 8601 พร้อม +07:00 |
| 400 | cursor_invalid | cursor ของการแบ่งหน้าไม่ถูกต้อง starting_after / ending_before ไม่ใช่ id ของรายการชนิดเดียวกัน หรือส่งทั้งสองค่าพร้อมกัน | ใช้ id ของรายการสุดท้ายในหน้าก่อนหน้า และส่งเพียงค่าเดียว |
| 409 | idempotency_conflict | Idempotency-Key ซ้ำแต่ body ต่าง ใช้ Idempotency-Key เดิมภายใน 24 ชม. กับคำขอที่เนื้อหาไม่เหมือนเดิม | สร้าง Idempotency-Key ใหม่ (UUID v4) ต่อ 1 การกระทำ |
| 404 | resource_not_found | ไม่พบรายการ id ไม่มีอยู่ หรือเป็นของร้านค้าอื่น | ตรวจ id และ X-Merchant-Id |
| 401 | authentication_failed | API key ไม่ถูกต้อง ไม่ได้ส่ง Authorization หรือ key ถูกเพิกถอน/หมุนแล้ว | ส่ง Authorization: Bearer pn_test_… (sandbox) หรือ pn_live_… (production) ที่ยังใช้งานได้ |
| 403 | merchant_mismatch | X-Merchant-Id ไม่ตรงกับ key key นี้ไม่มีสิทธิ์ทำรายการแทนร้านค้าที่ระบุ (ใช้กับบัญชี platform ที่ดูแลหลายร้าน) | ตรวจ X-Merchant-Id หรือขอสิทธิ์จากร้านค้าในแดชบอร์ด |
| 403 | insufficient_scope | key ไม่มีสิทธิ์ (scope) ที่ต้องใช้ restricted key ไม่ได้รับ scope ของ endpoint นี้ | สร้าง restricted key ใหม่ที่มี scope ตามที่ระบุใน endpoint |
| 429 | rate_limited | เรียกเกินโควตา เกินโควตาต่อ key หรือต่อ endpoint ในช่วงเวลา | รอตาม Retry-After แล้วลองใหม่แบบเว้นระยะเพิ่มขึ้น (exponential backoff + jitter) |
| 503 | service_unavailable | ปิดปรับปรุงหรือเครือข่ายปลายทางไม่ตอบ ระบบหรือเครือข่ายบัตร/ธนาคารปลายทางไม่พร้อมชั่วคราว | ลองใหม่ภายหลัง · ดูสถานะที่ status.paynara.example |
ไม่พบรหัสที่ค้นหา
Rate limit — โควตาการเรียก
| ขอบเขต | โควตา | Burst | หมายเหตุ |
|---|---|---|---|
| POST /v1/merchants/{id}/verifications | 10 ครั้ง/ชม./ร้าน | — | มีคำขอค้างได้ครั้งละ 1 |
| POST /v1/files | 20 ครั้ง/นาที | 40 | ≤ 10 MB/ไฟล์ |
| POST /v1/risk/assess · GET /v1/bins | 50–100 ครั้ง/วินาที | — | ผลแคชได้ 5 นาที |
| POST /v1/slips/verify | 30 ครั้ง/นาที | — | สลิปเดียวกันตรวจซ้ำได้ฟรีภายใน 10 นาที |
| POST /v1/bank-accounts/verify | 10 ครั้ง/นาที | — | กันการไล่ตรวจเลขบัญชี |
RateLimit-Limitโควตาของช่วงเวลาRateLimit-Remainingครั้งที่เหลือRateLimit-Resetวินาทีจนโควตาเริ่มใหม่- เกินโควตา → 429 พร้อม
Retry-After· แนะนำลองใหม่แบบเว้นระยะเพิ่มขึ้น + สุ่มเล็กน้อย (jitter)
HTTP/1.1 429 Too Many Requests
RateLimit-Limit: 100
RateLimit-Remaining: 0
RateLimit-Reset: 23
Retry-After: 23
{
"error": {
"code": "rate_limited",
"message": "เรียกเกินโควตา ลองใหม่ใน 23 วินาที",
"request_id": "req_2Kd9QwZ1"
}
}เวอร์ชันและ Changelog
เลือกเวอร์ชันด้วยหัว Paynara-Version (ไม่ส่ง = เวอร์ชันที่ผูกกับ API key) · การเปลี่ยนที่ไม่ทำให้โค้ดเดิมพัง (เพิ่มฟิลด์/endpoint) ออกในเวอร์ชันเดิมได้ · การเปลี่ยนที่ทำให้พังออกเป็นเวอร์ชันใหม่เสมอ และแจ้งล่วงหน้าอย่างน้อย 6 เดือนก่อนปิดเวอร์ชันเก่า
| เวอร์ชัน | สถานะ | รองรับถึง |
|---|---|---|
2026-08-01 ล่าสุด | ปัจจุบัน | — |
2025-11-15 | ยังรองรับ | 30 ก.ย. 2570 |
2024-06-01 | เลิกใช้แล้ว | 31 ธ.ค. 2569 |
- แก้ไข
2026-08-01slips/verify อ่านเวลาโอนบนสลิปเป็นปี พ.ศ. ผิดเป็น ค.ศ. ในบางรูปแบบ — แก้แล้ว
- เพิ่ม
2026-08-01POST /v1/slips/verify + webhook slip.duplicate_detected
- เพิ่ม
2026-08-01POST /v1/risk/assessments/{id}/feedback (Beta)
- เปลี่ยน
2026-08-01risk.reasons แสดงแต้มติดลบด้วย (เช่น ผ่าน 3-D Secure −6) ให้รวมแล้วเท่ากับ score
- ความปลอดภัย
2025-11-15representative.id_number ตอบกลับแบบปิดบังทุกเวอร์ชัน (เดิมเวอร์ชัน 2024-06-01 แสดงเต็ม)
- เพิ่ม
2025-11-15GET /v1/bins/{bin} · POST /v1/bank-accounts/verify · POST /v1/risk/assess
- เลิกใช้
2025-11-15payment.fraud_score (0–1) เลิกใช้ ใช้ payment.risk.score (0–100) — รองรับถึง 31 ธ.ค. 2569
- แก้ไข
2024-06-01dispute.evidence_due_by ไม่รวมวันหยุดราชการ ทำให้ครบกำหนดเร็วกว่าจริง — แก้แล้ว
- เพิ่ม
2024-06-01webhook dispute.evidence_due_soon แจ้งล่วงหน้า 3 วัน
เครื่องมือ: ตัวอธิบายคะแนนความเสี่ยง
ปรับปัจจัยแล้วดูคะแนน 0–100 เปลี่ยนทันที พร้อมแต้มของแต่ละปัจจัย — เกณฑ์ของร้าน: ต่ำกว่า 40 = allow · 40–69 = review · ตั้งแต่ 70 = block · ตัวอย่างจริงในระบบ: ORD-2610-0153 ได้ 12 และ ORD-2610-0158 ได้ 66
- 0
- 0
- 0
- 0
- 0
- 0
- 0
0/ 100
{}เครื่องมือ: ตรวจ BIN
พิมพ์เลข 6–8 หลักแรกของบัตร (ข้อมูล BIN ทั้งหมดเป็นตัวอย่างสมมติ) — เห็นผลแบบเดียวกับ GET /v1/bins/{bin} และคำแนะนำว่าควรเสนอผ่อนหรือแจ้งค่าธรรมเนียมบัตรต่างประเทศ