commerce
POST /v1/orders/{orderId}/paypal/capture
Capture a PayPal order the buyer completed.
การยืนยันตัวตน
ส่ง API key เป็น bearer token เอนด์พอยต์นี้ไม่ได้ระบุสิทธิ์การใช้งานเฉพาะในข้อกำหนด ดังนั้นควรให้คีย์ของคุณมีสิทธิ์น้อยที่สุดเท่าที่จำเป็นและให้ตรวจสอบจากการตอบกลับแทนที่จะคาดเดา
ปลายทางนี้ไม่ต้องใช้รหัสองค์กร คีย์ของคุณระบุองค์กรที่เป็นเจ้าของอยู่แล้ว และการตอบกลับจะถูกจำกัดขอบเขตไว้เฉพาะองค์กรนั้น
ทดลองใช้เลย
แทนที่สิ่งใดๆ ที่อยู่ภายในวงเล็บแหลมด้วยค่าของคุณเอง และตัวยึดตำแหน่งคีย์ด้วยคีย์จากแดชบอร์ดของคุณ
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