Here you find details of the calls that enable you to capture your orders and add shipping information to track them. For each call, you can find a description, technical details, and sample requests and responses.
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:
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
Body
If the request is successful, you'll receive a 201 Created
response including capture_id
and location
as HTTP response headers.
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.
Ready to send this request? See the API reference of this call.
Use the Order management API to partially capture an order.
When you partially fulfill the order (for example, you have sent some of the products to the customer but not all of them), you need to capture the amount for the sent items through this API call.
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 sent.
To capture a part of the 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 partial order amount to be captured. It must be less than the total order_amountreference
(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 captureshipping_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.If the request is successful, you'll receive a 201 Created
response including capture_id
and location
as HTTP response headers.
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.
Ready to send this request? See the API reference of this call.
Use the Order management API to check the details of a capture.
When you want to check the details of a capture, this API call provides you with capture information like shipping info, order lines, capture id, amount, and date.
To check the capture details, send a GET
request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/captures/{capture_id}
endpoint.
Provide the order_id
and the specific capture_id
you want to know about. 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.
In response to your call, you receive a data object containing the capture details.
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.
Ready to send this request? See the API reference of this call.
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 shipmentreturn_tracking_uri
: URL where the customer can track the return shipmentshipping_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 shipmenttracking_uri
: URI where the customer can track their shipmentYou 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.
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.
Ready to send this request? See the API reference of this call.
Use the Order management API to trigger a new send out of customer communication.
When you want to inform your customers about changes in their orders, use this API call to trigger an email to the customer with the latest details. This is also useful when your customer didn't receive the payment instructions or invoice as expected, and you want to send the information.
To trigger the send out of customer communications, send a POST
request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/trigger-send-out
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.
You don't need a request body for this POST
method.
If the request is successful, you'll receive a 204 No content
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.
Ready to send this request? See the API reference of this call.