commerce
POST /v1/orders/{orderId}/paypal/capture
Capture a PayPal order the buyer completed.
احراز هویت
یک کلید API را به عنوان یک توکن برbearer ارسال کنید. این نقطه پایانی مجوز خاصی را در مشخصات خود ذکر نمیکند، بنابراین به جای فرض کردن، حداقل نیازهای کلید خود را بدهید و پاسخ را بررسی کنید.
این نقطه پایانی هیچ شناسه سازمانی را دریافت نمیکند. کلید شما در حال حاضر سازمان مربوطه را مشخص میکند و پاسخ در همان محدوده ارائه میشود.
امتحان کنید
هر چیزی را که داخل براکتهای زاویهدار قرار دارد با مقادیر خودتان جایگزین کنید، و نگهدارنده کلید را با کلیدی از داشبورد خود جایگزین نمایید.
curl -X POST https://api.zinndigital.com/v1/orders/{orderId}/paypal/capture \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "paypal_order_id": <string> }'وارد شدهاید؟ کنسول API در داشبورد شما شناسه سازمان واقعی و کلید خودتان را پر میکند و درخواست را روی API زنده اجرا میکند تا بتوانید پاسخ واقعی را ببینید. این نقطه پایانی را در کنسول API باز کنید
جزئیات
Settles the order against a PayPal order the buyer has approved (wallet) or paid by card (including any 3-D Secure step). ⛔ **The browser is not believed.** It reports that the buyer finished; only PayPal's capture response says money moved, and only the engine writes a payment. Posting an invented `paypal_order_id` produces a gateway error, never a paid order. A **declined card answers 200** with the order `payment_failed`, for the same reason `payOrder` does — the attempt was processed exactly as asked.
پارامترها
| نام | نوع | الزامی | چیست |
|---|---|---|---|
orderId (path) | Uuid | بله | The order's id. |
بدنه درخواست
| نام | نوع | الزامی | چیست |
|---|---|---|---|
paypal_order_id | string | بله | The id returned by `openPayPalOrder` and completed in the browser. |
پاسخ
| نام | نوع | الزامی | چیست |
|---|---|---|---|
id | Uuid | بله | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | بله | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | بله | Human-friendly order reference. |
status | OrderStatus | بله | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | بله | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | بله | — |
tax_minor | integer | بله | — |
discount_minor | integer | بله | — |
total_minor | integer | بله | — |
billing_country | object | خیر | — |
placed_at | object | خیر | — |
created_at | string | بله | — |
updated_at | string | خیر | — |
lines | OrderLine[] | بله | — |
payments | Payment[] | بله | — |
خطاهایی که این نقطه پایانی میتواند برگرداند
401 · 403 · 404 · 422 · 429 · 503