Skip to content
เอกสาร APIP2P EasyPay

Payin cancel ​

POST /v1/pay/deposits/{id}/cancel

js
import { clientFromEnv } from './client.mjs';
const client = clientFromEnv();
const request = client.cancelPayin(
  'dep_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
  'ลูกค้าขอยกเลิกก่อนมีคำสั่งโอน',
  'order-1001-cancel',
);
const result = await request.send();

200 พร้อม status: canceled คือยกเลิกสำเร็จ ก่อนส่งครั้งแรกเก็บ rawBody เป็น text/bytea ไม่ใช่ JSONB พร้อม method/path/query/idempotencyKey/apiVersion หาก retry ใช้คำขอเดิม หลังรีสตาร์ตใช้ client.rebuild(storedRequest).send() ตาม เริ่มต่อ API

ยกเลิกได้เมื่อไหร่ ​

โหมดเงื่อนไข
LIVEรายการของ Merchant เองที่ยัง awaiting_liquidity และไม่เคยออกบัญชี/QR/คำสั่งโอนหรือรับหลักฐาน
Sandboxรายการจำลอง awaiting_payment ที่ยัง pending และอยู่ในรอบปัจจุบัน

LIVE ที่เป็น awaiting_payment หรือเคยออกคำสั่งให้ลูกค้าโอนแล้ว จะได้ 409 deposit_not_cancelable แม้ยังไม่มีสลิป ห้ามถือว่า order ถูกยกเลิกเมื่อ API ยังไม่ยืนยัน

PHP และ request body
php
$prepared = $client->cancelPayin($depositId, 'ลูกค้าขอยกเลิกก่อนมีคำสั่งโอน', $persistedCancelKey);
$result = $client->send($prepared);

body มีเพียง { "reason": "ลูกค้าขอยกเลิกก่อนมีคำสั่งโอน" } ความยาว 1–500 Unicode codepoints ไม่มี control characters คำสั่งนี้ไม่ใช่การคืนเงิน อ่าน เงื่อนไขและ error แบบละเอียด

เอกสารชุดนี้อิงสัญญา API เวอร์ชัน 2026-08-01