Skip to main content

Transaction Costs

Allows you to upload payment & transaction costs for orders via API

Frank Birzle avatar
Written by Frank Birzle
Updated this week

⚠️ Please note:

This endpoint is currently only compatible when mapping with orders of the following shop data sources in Klar: Shopify, Shopware 5 & 6, Oxid, WooCommerce and Centra.

For all other use-cases please contact our customer support team via our in-app Chat or via [email protected].


1. Base URL and Versioning

The base URL of the Klar API is https://open-api.getklar.com/ followed by a version string, e.g. 06.2024.

Good to know: You can find a full definition of the API endpoints and the available versions in our automatically generated API specification.

2. Endpoint Overview and General Info

Good to know: If a field is marked as required in the API specification it has to be present in the submission. If it's not required and present it has to have a valid value, e.g. cancelledAt can't be submitted with a 0 value and has to be set to undefined.

The Transaction Costs API provides the following endpoints:

  • POST /<VERSION>/transaction-costs/json

  • GET /transaction-costs/status

POST /<VERSION>/transaction-costs/json

This endpoint allows you to upload your payment & transaction costs data to Klar.

The request body should contain a JSON object that can contain an array of up to 1000 JSON objects of type TransactionCosts.


With this endpoint you can both create and update transaction costs. Simply submit the same costs again with corrected or updated fields, e.g. if the amount of transaction costs for an order changes .

We currently don't offer an endpoint for completely deleting uploaded data. If you want to delete a submission, please write our customer support team via our in-app Chat or via [email protected].

Returns a HTTP Code 201 and the following response body:

{
"status": "VALID"
}

Returns a HTTP Code 400 and a validator message if there was an error:

{   
"status": "INVALID",
"errors": [
{
"id": 1111,
"key": "0.orderId",
"message": "orderId must be a string",
"value": 1111
}
]
}

GET /transaction-costs/state

This endpoint allows to query a few metrics, like the total amount of transaction costs submitted total, the amount of submitted in the last submission lastBatchCount and the time of the last successful / failed submission lastSuccess / lastFailure.

Returns a HTTP 200 status code and a response body:

{
"total": "9",
"lastBatchCount": "4",
"lastSuccess": "2023-03-11T12:13:31.193Z",
"lastFailure": "2023-03-11T09:06:50.321Z"
}
Did this answer your question?