commerce
POST /v1/orders/{orderId}/refund-request
Request a refund for an order.
احراز هویت
یک کلید API را به عنوان یک توکن حامل ارسال کنید. این کلید باید دارای مجوز billing.payment.manage باشد؛ کلیدی که فاقد آن باشد با خطای 403 رد میشود، نه 404.
جایی که شناسه سازمان شما قرار میگیرد
این نقطه پایانی org_id را به عنوان یک فیلد در بدنه JSON دریافت میکند.
شناسه سازمان شما در صفحه کلیدهای 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