# Capture and track orders This page details API calls for capturing orders and adding shipping information for tracking purposes. Each call includes a description, technical details, and sample requests and responses. ## Capture the full order amount Use the Order management API to fully capture an order. When you fulfill an order, capture the total amount using this API call. This triggers the payment to your bank account. The following sequence diagram illustrates the process: ```mermaid sequenceDiagram autonumber participant A as MERCHANT participant B as KUSTOM A ->> B: POST /ordermanagement/v1/orders/{order_id}/captures note over A, B: Provide the capture amount (full or partial) alt SUCCESSFUL B -->> A: 201: Created includes capture_id, location else ERROR B -->> A: 403: correlation_id, error_code, error_message end ``` **To capture the full order amount:** - **Header:** - `Klarna-Idempotency-Key`: A unique header to ensure idempotency. Recommended to be a UUID v4. - **Body:** - `captured_amount`: (Required) The total order amount to be captured. Must match the `order_amount` from the order creation. - `reference`: (Optional) Internal reference for the capture. - `description`: (Optional) Description of the capture for the customer. - `order_lines`: (Optional, but recommended) Details related to the capture. We recommend displaying these for better visibility both in the Kustom portal and to the end consumer, if they paid with Klarna. - `shipping_info`: (Optional) Shipping details (company, tracking number). Required for physical goods. **Example Request (JSON):** ```json { "captured_amount": 6000, "reference": "c9a94cf1-7126-4f55-92fa-4d34f416ed7f", "description": "Shipped the full order", "order_lines": [ { "type": "physical", "reference": "123050", "name": "Tomatoes", "quantity": 10, "quantity_unit": "kg", "unit_price": 600, "tax_rate": 2500, "total_amount": 6000, "total_tax_amount": 1200 } ], "shipping_info": [ { "shipping_company": "Postnord", "tracking_number": "1234567890" } ] } ``` **Success Response:** A `201 Created` response with `capture_id` and `location` headers. **Error Response:** An error response with `correlation_id`, `error_code`, and `error_messages` if the request fails. ## Capture part of the order amount Use the same endpoint for partial captures. Capture the amount for the shipped items. **Request details similar to full capture.** ## Check the details of a capture Get details of a capture using a `GET` request. **Endpoint:** `/ordermanagement/v1/orders/{order_id}/captures/{capture_id}` **Success Response:** A JSON object containing capture details. **Error Response:** An error response if the request fails. ## Add shipping information to a capture Add shipping information to a captured order via a `POST` request. **Endpoint:** `/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/shipping-info` **Required parameters:** - `shipping_info`: An array of shipping objects containing company, tracking number, and tracking URI. **Example Request (JSON):** ```json { "shipping_info": [ { "return_shipping_company": "DHL US", "return_tracking_number": "93456415674545679888", "return_tracking_uri": "http://shipping.example/findmypackage?93456415674545679888", "shipping_company": "DHL US", "shipping_method": "Home", "tracking_number": "63456415674545679874", "tracking_uri": "http://shipping.example/findmypackage?63456415674545679874" } ] } ``` **Success Response:** A `204 No content` response. **Error Response:** An error response if the request fails.