Klarna Docs - Add shipping information to capture

Add shipping information to capture

Use the Order management API to add shipping information to an order and enable delivery tracking.

When you want to add shipping details to an order, you have two ways to attach this information. One option is to send the shipping details in the request body when capturing an order. Another option is to send the shipping details after capturing the order, as explained in this API call.

By adding the shipping details to an order, you make this information available to your customers so that they can keep track of the delivery.

To add the shipping information to a captured order, send a POST  request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/shipping-info  endpoint.

Provide order_id and capture_id as path parameters. The order_id is the identifier you get in a successful response when placing a new order, and the capture_id is the identifier you get when successfully capturing an order.

Include the following required body parameters in your request:

  • return_shipping_company : name of the shipping company for the return shipment
  • return_tracking_number : tracking number that identifies the return shipment
  • return_tracking_uri : URL where the customer can track the return shipment
  • shipping_company : logistics company (carrier) managing the delivery. For more information, see the carrier list.
  • shipping_method : method for delivering the goods
  • tracking_number : tracking number that identifies the shipment
  • tracking_uri : URI where the customer can track their shipment
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"

Sample request to add shipping information.

You can add shipping information for two different items in the same call. For example, suppose a single order includes two packages associated with two different shipments and tracking numbers; in that case, you have to send the shipping_info details for each item.

You can learn more about shipping companies in the Carrier partner section.

If your request is successful, you'll receive a 204 No content response.

Error response

If your request contains errors, you'll receive an error response. Ensure the order_id and the capture_id values you provided are valid and correctly formatted.

You can use the correlation_id and the order_id values to troubleshoot the call in the Merchant portal logs section.

JSON
{
  "error_code": "NO_SUCH_ORDER",
  "error_messages": [
    "Order 7849fd84-47dc-4919-a7ce-47b9f46156f cannot be found. Shipping info cannot be added to capture 32904e4c-61d2-400e-9b77-b4a45d612."
  ],
  "correlation_id": "f072554f-ef99-4b21-85da-633355aab998"
}

Sample of an error response to add shipping information.

Ready to send this request? See the API reference of this call.