Delivery
The following actions can be taken when the item is being shipped from your store.
Capture the full amount.
Capture part of the order amount.
Prerequisites
- You have already obtained your API credentials
- A purchase has been made
- You have retrieved and acknowledge an order as described on the Confirm purchase page
Capture the full amount
Use this call when fulfillment is completed, e.g. physical products are being shipped to the customer.
Use case
You have sent the goods to the customer and want to capture the amount for the item(s). This will trigger the settlement from Klarna to you for the order, in accordance to the terms of your contract.
1. Add the order information and make the API call
The captured_amount
must be equal to or less than the order’s remaining_authorized_amount
.
Shipping address is inherited from the order.
The capture amount can optionally be accompanied by a descriptive text and order lines for the captured items.
Shipping Information:
If you are shipping physical goods, you should have tracking information available at this point. The capture call therefore provides the possibility to transmit the tracking data for the shipment to Klarna. Read more about delivery tracking .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
POST /ordermanagement/v1/orders/{order_id}/captures Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= Content-Type: application/json { "captured_amount": 6000, "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": "DHL US", "tracking_number": "1234567890", "return_shipping_company": "UPS", "return_tracking_number": "112233445566778899" } ] }
2. Handle the response from Klarna
Klarna will respond with 201
- Created or an error message
1 2
HTTP/1.1 201 Created Location: http://klarna/orders/{order_id}/captures/{capture_id}
Capture part of the order amount
Use this call when part of the fulfillment is completed, e.g. for some, but not all, of the physical goods are shipped to the customer.
Use case
You have sent at least part of the order to the customer and want to capture the amount for the item(s) that have been shipped.
1. Add the order information and make the API call
The captured_amount
must be equal to or less than the order’s remaining_authorized_amount
.
Shipping address is inherited from the order.
The capture amount can optionally be accompanied by a descriptive text and order lines for the captured items. Adding order lines enables Klarna to better visualize the settlement details for the customer.
Shipping Information:
If you are shipping physical goods, you should have tracking information available at this point. The capture call therefore provides the possibility to transmit the tracking data for the shipment to Klarna. Read more about delivery tracking .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
POST /ordermanagement/v1/orders/{order_id}/captures Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= Content-Type: application/json { "captured_amount": 1200, "description": "Shipped part of the order", "order_lines": [ { "type": "physical", "reference": "123050", "name": "Tomatoes", "quantity": 2, "quantity_unit": "kg", "unit_price": 600, "tax_rate": 2500, "total_amount": 1200, "total_tax_amount": 200 } ], "shipping_info": [ { "shipping_company": "DHL US", "tracking_number": "1234567890", "return_shipping_company": "UPS", "return_tracking_number": "112233445566778899" } ] }
2. Handle the response from Klarna
Klarna will respond with 201
- Created or an error message
1 2
HTTP/1.1 201 Created Location: http://klarna/orders/{order_id}/captures/{capture_id}
What’s next?
You have now implemented all the features you need to handle your delivery process, you can now continue to implement the post delivery calls.