commerce
POST /v1/orders/{orderId}/refund-request
Request a refund for an order.
การยืนยันตัวตน
ส่ง API key ในรูปแบบ bearer token คีย์ดังกล่าวต้องมีสิทธิ์ billing.payment.manage หากไม่มีสิทธิ์ ระบบจะปฏิเสธด้วยรหัส 403 แทนที่จะเป็น 404
ตำแหน่งสำหรับใส่รหัสองค์กรของคุณ
Endpoint นี้รับ org_id เป็นฟิลด์ใน JSON body
รหัสองค์กรของคุณจะแสดงอยู่บนหน้าคีย์ API ในแดชบอร์ดของคุณ โดยอยู่ถัดจากคีย์นั้นๆ รหัสนี้จะเป็นรหัสเดิมในการเรียกใช้งานทุกครั้งของคุณ
ทดลองใช้เลย
แทนที่สิ่งใดๆ ที่อยู่ภายในวงเล็บแหลมด้วยค่าของคุณเอง และตัวยึดตำแหน่งคีย์ด้วยคีย์จากแดชบอร์ดของคุณ
curl -X POST https://api.zinndigital.com/v1/orders/{orderId}/refund-request \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'เข้าสู่ระบบแล้วใช่ไหม คอนโซล API ในแดชบอร์ดของคุณจะเติมรหัสองค์กรจริงและคีย์ของคุณเองโดยอัตโนมัติ และทำการส่งคำขอไปยัง API จริง เพื่อให้คุณเห็นผลลัพธ์ที่เป็นข้อมูลจริง เปิดจุดสิ้นสุดนี้ในคอนโซล API
รายละเอียด
Opens a refund request per the policy: within the 30-day money-back window the refund is issued immediately (status `auto_approved`); otherwise a pro-rata request is recorded `pending` for staff approval (docs/05 §4.13). The amount and approval path come from the server, never the client. Requires `billing.payment.manage`.
พารามิเตอร์
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
orderId (path) | Uuid | ใช่ | The order's id. |
เนื้อหาคำขอ
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
org_id | Uuid | ไม่ใช่ | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
reason | string | ไม่ใช่ | — |
to_wallet | boolean | ไม่ใช่ | Where the refund goes. Omit it and the money is returned to the original payment method — the money-back guarantee is money back, and store credit is an opt-in the customer has… |
การตอบกลับ
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
id | Uuid | ใช่ | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | ใช่ | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
order_id | Uuid | ใช่ | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
status | RefundRequestStatus | ใช่ | A refund request's lifecycle state (docs/05 §4.13). |
policy_class | RefundPolicyClass | ใช่ | How the refund policy classified a request (captured at request time). |
amount | MoneyAmount | ใช่ | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
to_wallet | boolean | ใช่ | Refund destination, frozen at request time — `false` (the default) reverses the original payment, `true` credits the account wallet. Any part of the order that was settled from… |
reason | string | ใช่ | — |
decided_by | string | ใช่ | — |
decision_note | string | ใช่ | — |
decided_at | object | ใช่ | — |
refund_reference | string | ใช่ | Set once the refund has been issued (its idempotency key). |
created_at | string | ใช่ | — |
updated_at | string | ใช่ | — |
ข้อผิดพลาดที่เอนด์พอยต์นี้สามารถส่งกลับได้
401 · 403 · 404 · 409 · 422 · 429