commerce
POST /v1/orders/{orderId}/paypal/capture
Capture a PayPal order the buyer completed.
Autenticación
Envía una clave de API como token de portador. Este endpoint no especifica un permiso concreto en la especificación, así que otorga a tu clave los mínimos privilegios necesarios y comprueba la respuesta en lugar de dar por sentado.
Este endpoint no requiere ningún id de organización. Su clave ya identifica la organización a la que pertenece, y la respuesta está delimitada a ella.
Pruébalo
Reemplaza cualquier elemento entre corchetes angulares por tus propios valores, y el marcador de posición key con una clave de tu panel de control.
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> }'¿Has iniciado sesión? La consola de la API en tu panel de control rellena el ID de tu organización real y tu propia clave, y ejecuta la solicitud contra la API en vivo para que puedas ver la respuesta real. Abre este endpoint en la consola de la API
Detalles
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.
Parámetros
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
orderId (path) | Uuid | Sí | The order's id. |
Cuerpo de la solicitud
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
paypal_order_id | string | Sí | The id returned by `openPayPalOrder` and completed in the browser. |
Respuesta
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
id | Uuid | Sí | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Sí | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Sí | Human-friendly order reference. |
status | OrderStatus | Sí | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Sí | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Sí | — |
tax_minor | integer | Sí | — |
discount_minor | integer | Sí | — |
total_minor | integer | Sí | — |
billing_country | object | No | — |
placed_at | object | No | — |
created_at | string | Sí | — |
updated_at | string | No | — |
lines | OrderLine[] | Sí | — |
payments | Payment[] | Sí | — |
Errores que este endpoint puede devolver
401 · 403 · 404 · 422 · 429 · 503