Klarna Docs - Capture the full order amount

Capture the full order amount

Use the Order management API to fully capture an order.

When you fulfill the order (for example, you have sent the products to your customer), you need to capture the total amount for the items through this API call.

Capturing the full order amount triggers the payments we send to your bank account based on your contract.

The following diagram depicts how this API call works:

Sequence diagram of the API call to capture the full order amount.

You can use the same endpoint for making full and partial captures. For a full capture, you send the total order amount. For a partial capture, you only send the order amount corresponding to the items you shipped.

To capture the full order amount, send a POST  request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/captures endpoint.

Include the following in your request:

Header

  • Klarna-Idempotency-Key : This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts.

Body

  • captured_amount (required): the total order amount to be captured. It must be equal to the order_amount from the order creation
  • reference (optional): Internal reference to the capture. This will be included in the settlement files.
  • description  (optional): Description of the capture shown to the customer.
  • order_lines  (optional): list of details associated with this capture. This is recommended if you want to show capture details in the Klarna's app
  • shipping_info (optional): shipping details such as company and tracking number. If you're shipping physical goods, you need to have shipping information available at this point. For more information, see the Add shipping information section.
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,

Sample request to capture an order.

If the request is successful, you'll receive a 201 Created response including capture_id and location as HTTP response headers.

Error response

If your request contains errors, you'll receive an error response. Make sure the order_id is correct.

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

JSON
{
  "correlation_id": "66782175-ae05-44fc-9eb3-eeceadbad271",
  "error_code": "NO_SUCH_ORDER",
  "error_messages": [
    "string"
  ]
}

Sample of an error response to capture an order.

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