commerce
POST /v1/orders/{orderId}/paypal/capture
Capture a PayPal order the buyer completed.
Аутентификация
Передайте API-ключ в качестве маркера носителя (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