commerce
POST /v1/orders/{orderId}/refund-request
Request a refund for an order.
Xác thực
Gửi khóa API dưới dạng mã thông báo bearer. Khóa này phải có quyền billing.payment.manage; khóa không có quyền này sẽ bị từ chối với mã lỗi 403, không phải 404.
Nơi điền id tổ chức của bạn
Endpoint này nhận org_id làm một trường trong phần thân JSON.
Mã tổ chức của bạn nằm ở màn hình khóa API trong bảng điều khiển, ngay bên cạnh khóa đó. Đây là cùng một mã trong mọi lệnh gọi mà bạn thực hiện.
Dùng thử
Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.
curl -X POST https://api.zinndigital.com/v1/orders/{orderId}/refund-request \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API
Chi tiết
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`.
Tham số
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
orderId (path) | Uuid | Có | The order's id. |
Nội dung yêu cầu
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
org_id | Uuid | Không | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
reason | string | Không | — |
to_wallet | boolean | Không | 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… |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
id | Uuid | Có | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Có | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
order_id | Uuid | Có | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
status | RefundRequestStatus | Có | A refund request's lifecycle state (docs/05 §4.13). |
policy_class | RefundPolicyClass | Có | How the refund policy classified a request (captured at request time). |
amount | MoneyAmount | Có | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
to_wallet | boolean | Có | 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 | Có | — |
decided_by | string | Có | — |
decision_note | string | Có | — |
decided_at | object | Có | — |
refund_reference | string | Có | Set once the refund has been issued (its idempotency key). |
created_at | string | Có | — |
updated_at | string | Có | — |
Các lỗi điểm cuối này có thể trả về
401 · 403 · 404 · 409 · 422 · 429