Create Slip Payment

Create a slip session for slip-based fiat payment. Returns a session token and a redirect URL where the depositor transfers and submits the slip.

Same call as Create P2P

Create Slip and Create P2P share this endpoint, body, and response. See Create P2P for how deposits are matched with withdrawals

How to use in 4 steps

You call the API once at the start and take the webhook at the end; the customer does the rest on our page

1

Create the payment

You

Send the amount and the account the customer will transfer from, plus X-Idempotency-Key — a new UUID per request; it only blocks a double submit within 5 seconds

RequestPOST /v1/p2p/public/session/create
{
  "role": "DEPOSITOR",
  "amount": 200,
  "ttl_seconds": 1200,                // link lives 20 minutes
  "profile": { "depositor": {
    "sender_bank": "SCB",          // account the customer pays from
    "sender_account": "1234567890"
  }},
  "order_id": "ODRW-322863625",
  "order_user_reference": "USER134",
  "return_url": "https://merchant.example.com/deposit/done"
}
Response — one field is all you need200
"redirect_url": "https://demo.sky777881.xyz/pay/slip/yUFSwamgJN…"
2

Send the customer the link

You

Redirect them there, or send the link over any channel — it expires after ttl_seconds

https://demo.sky777881.xyz/pay/slip/yUFSwamgJNkxcvWC_UY-okEzM3C9jOjSaqhMxWpEaAk
3

Wait while the customer pays

Customeron our page

Everything happens on that page and you never check the slip yourself — the customer must transfer from the exact account you registered

Transfer 200 THBfrom SCB ••7890
Attach the slip
System checks itrejected? attach again
The hosted payment page: amount, countdown, PromptPay QR, and the account to transfer from
The page the customer lands on
4

Take the webhook, close the order

Platform → youPayload examples

Credit the customer once per payment, only after PAYMENT_PAID — not when the create call succeeds or the page returns to return_url

PAYMENT_PAID

The transfer landed — credit order ODRW-322863625

PAYMENT_FAILED

The slip was already used (DUPLICATE_SIGNATURE)

PAYMENT_CANCELED

Cancelled — possibly an old order auto-cancelled when the same payer created a new one; identify the cancelled order by data.payment.id

Expired with no accepted slip = no webhook — poll GET /v1/payment/info yourself

POSTCreate Slip Payment
Endpoint URL
https://testnet.trustsig.xyz/v1/p2p/public/session/create

Authentication Status

API Key is required for all requests Webhook Secret

Headers

x-api-key
Required

Your shop API key

x-signature
Required

HMAC-SHA256 of timestamp|method|fullUrl|body signed with your secret key, sent as 64 hex characters

How to create the signature
x-timestamp
Required

Current Unix time in milliseconds — must be the same value used to create x-signature

X-Idempotency-Key
Required

UUID ใหม่ทุก request ระบบใช้กันการส่งซ้ำภายใน 5 วินาที request ที่ซ้ำในช่วงนั้นจะได้ 409 (code 29000) และไม่ได้ response เดิมกลับมา ถ้าไม่ส่ง header นี้จะได้ 400 (code 1001)

Parameters (Request Body)

role
enum Optional

บทบาทของ session ถ้าไม่ส่งจะเป็น GENERIC ซึ่งได้สิทธิ์ถอนเงินด้วย สำหรับหน้านี้ให้ส่ง DEPOSITOR ทุกครั้ง

ttl_seconds
number Optional

อายุของ session เป็นวินาที (เช่น 1200 = 20 นาที) ถ้าไม่ส่งจะใช้ 1800 (30 นาที) ส่งได้สูงสุด 3600 ควรตั้งให้เกิน 600 เพราะถ้า session เหลือเวลาไม่ถึง 10 นาที ลูกค้าจะเริ่มรายการฝากไม่ได้ (38072)

profile.depositor.sender_bank
string Required

รหัสธนาคารของผู้ฝาก เช่น SCB, KBANK, BBL ตัวพิมพ์เล็กหรือใหญ่ก็ได้ หรือส่งเลขธนาคาร 3 หลักแทน เช่น 014 ถ้าลูกค้าจ่ายผ่านเป๋าตังให้ส่ง G_WALLET ดูรหัสทั้งหมดได้จาก GET /v1/ebank/bankConfig?purpose=payer — role DEPOSITOR ต้องส่ง profile.depositor ทุกครั้ง

profile.depositor.sender_account
string Required

เลขบัญชีธนาคารของผู้ฝาก ยาว 5–30 ตัวอักษร ถ้า sender_bank เป็น G_WALLET ให้ใส่เลขบัญชีธนาคาร 10 หลักที่ลูกค้าใช้เติมเงินเข้าเป๋าตัง ไม่ใช่เลขกระเป๋า

amount
number Optional

จำนวนเงินที่ต้องการชำระ (หน่วยเป็นบาท) ต้องเป็นจำนวนเต็มร้อย เช่น 400 หรือ 1100 ระบบตรวจยอดตั้งแต่ตอนสร้าง session ยอดอย่าง 487 จะได้ 38002 และไม่ได้ session ถ้าร้านยังใช้ยอดแบบตัวเลือก ยอดต้องตรงกับตัวเลือกใน Option List

order_id
string Optional

Your order reference, up to 200 characters. Optional, but recommended: it is attached to the deposit the customer creates from this session. While a session with the same order_id is still alive, a new one is refused with 38045. You may send it as profile.depositor.order_id instead; if both are sent, the profile value wins.

order_user_reference
string Optional

Your ID for the customer (for example the user ID in your system), not their name. Up to 200 characters, optional. A customer with this reference, or with the same sender account, who still has a transfer in progress cannot open a new session (409, 38078). You may send it as profile.depositor.order_user_reference instead; if both are sent, the profile value wins.

return_url
string Optional

URL ที่จะ redirect กลับเมื่อทำรายการเสร็จสิ้น ต้องเป็น URL เต็มที่ขึ้นต้นด้วย https:// หรือ http:// ยาวไม่เกิน 2000 ตัวอักษร

flow_id
string Optional

ใช้เปิด session ใหม่ให้รายการที่มีอยู่แล้ว เช่น เมื่อได้ 409 รหัส 38078 (ลูกค้ายังมีรายการโอนค้าง) ให้ส่ง flow_id ที่อยู่ใน data ของ error นั้น รูปแบบ p2p:<id>, classic:<id> หรือ classic-deposit:<id> ปกติไม่ต้องส่ง

display.color
string Optional

สีของหน้าชำระเงิน ส่งเป็น "สีหลัก" หรือ "สีหลัก,สีพื้น" เช่น "blue,zinc" — สีหลัก: red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose · สีพื้น: gray, zinc, neutral

display.theme
enum Optional

โหมดสีของหน้าชำระเงิน

display.name
string Optional

ชื่อร้านที่แสดงบนหน้าชำระเงิน ไม่เกิน 100 ตัวอักษร — ทั้ง display ใช้ปรับหน้าตาอย่างเดียว ไม่มีผลกับยอดหรือบัญชีปลายทาง ถ้าค่าไม่ถูกต้องจะได้ 422