Payments

Guarded capture of an approved PayPal order

POST
/payments/{id}/capture

Guarded capture of an approved PayPal order. Requires the OWNER role. Idempotent: send an Idempotency-Key.

Authorization

__Host-qm_session<token>

Session cookie set by sign-in on HTTPS deployments (the hosted demo).

In: cookie

Path Parameters

id*string

Resource id (UUID).

Formatuuid

Header Parameters

X-Requested-With*string

CSRF guard: must be quartermaster on every mutation.

Idempotency-Key*string

A unique key per user action; retries with the same key return the first result.

Length8 <= length <= 128

Request Body

application/json

Capture a PayPal order the buyer approved.

Capture a PayPal order the buyer approved.

paypal_order_id*string

PayPal Orders v2 order id.

Match^[A-Z0-9-]+$
Length5 <= length <= 64

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/payments/0f8fad5b-d9cb-469f-a165-70867728950e/capture" \  -H "X-Requested-With: quartermaster" \  -H "Idempotency-Key: 3b8c2c1e-6f6d-4a59-9a43-8f0c2a9e1d22" \  -H "Content-Type: application/json" \  -d '{    "paypal_order_id": "5O190127TN364715T"  }'
{  "payment": {    "id": "string",    "intent_id": "string",    "purchase_order_id": "string",    "status": "CREATED",    "paypal_order_id": "string",    "paypal_capture_id": "string",    "amount_minor": 0,    "currency": "string",    "captured_amount_minor": 0,    "refunded_amount_minor": 0,    "failure_code": "string",    "failure_message": "string",    "created_at": "string",    "updated_at": "string",    "completed_at": "string"  },  "purchase_order": {    "id": "string",    "number": "string",    "request_id": "string",    "supplier_id": "string",    "supplier_name": "string",    "status": "PROPOSED",    "currency": "string",    "subtotal_minor": 0,    "shipping_minor": 0,    "tax_minor": 0,    "fees_minor": 0,    "total_minor": 0,    "cart_hash": "string",    "items": [      {        "id": "string",        "kind": "PRODUCT",        "sku": "string",        "description": "string",        "category": "food_packaging",        "quantity": 0,        "unit_price_minor": 0,        "line_total_minor": 0,        "inventory_item_id": "string",        "pack_quantity": 0      }    ],    "policy_decision": {      "id": "string",      "purchase_order_id": "string",      "decision": "ALLOW",      "violations": [        {          "code": "MANDATE_INACTIVE",          "severity": "BLOCK",          "message": "string",          "evidence": {}        }      ],      "checks": [        {          "code": "string",          "passed": true,          "detail": "string"        }      ],      "human_approval_required": true,      "mandate_version": 0,      "policy_version": "string",      "input_digest": "string",      "evaluated_at": "string"    },    "certificate": {      "id": "string",      "status": "ACTIVE",      "payload": {        "certificate_version": 1,        "intent_id": "string",        "organization_id": "string",        "buyer_id": "string",        "purchase_order_id": "string",        "supplier_id": "string",        "cart_hash": "string",        "mandate_id": "string",        "mandate_version": 0,        "policy_decision_id": "string",        "currency": "string",        "approved_amount_minor": 0,        "approved_at": "string",        "expires_at": "string",        "nonce": "string",        "key_id": "string"      },      "key_id": "string",      "signature": "string",      "algorithm": "Ed25519",      "issued_at": "string",      "expires_at": "string"    },    "payment": {      "id": "string",      "intent_id": "string",      "purchase_order_id": "string",      "status": "CREATED",      "paypal_order_id": "string",      "paypal_capture_id": "string",      "amount_minor": 0,      "currency": "string",      "captured_amount_minor": 0,      "refunded_amount_minor": 0,      "failure_code": "string",      "failure_message": "string",      "created_at": "string",      "updated_at": "string",      "completed_at": "string"    },    "delivery": {      "id": "string",      "purchase_order_id": "string",      "supplier_id": "string",      "status": "SCHEDULED",      "expected_date": "string",      "original_expected_date": "string",      "delivered_at": "string",      "delay_reason": "string",      "data_source": "SYNTHETIC"    },    "created_at": "string"  }}