> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://ixopay.ferndocs.com/developer-hub/documentation/guides/payments/after-the-payment/settling-payments/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://ixopay.ferndocs.com/_mcp/server. # Settling payments In the payment industry, the process of settling payments refers to the transfer of funds from a customer's account to the merchant's account. This typically occurs after a transaction has been authorized, captured, and/or preauthorized. Settlements can also include fees charged by the IXOPAY platform or other intermediaries involved in the transaction. > **IXOPAY platform Full Version** > > Settlement post-processing is an optional feature which is not automatically available for all IXOPAY platform clients! > > If you want to get access to all IXOPAY platform features you need to upgrade your plan. Please contact your Customer Success Manager or our sales team at [sales@ixopay.com](mailto:sales@ixopay.com) for more information. The process of settling payments can present challenges for eCommerce enterprises as different payment service providers (PSPs) handle settlements in different ways. Settlement data can be provided in different formats (JSON, XML, CSV, Fixed-width file, EPPRC, GRRCN, CAMT.054) with varying semantics and granularity depending on the underlying payment method. To help developers manage settlements, the IXOPAY platform provides a post-processing engine that standardizes the settlement process and resolves conflicts across different PSPs and payment methods. This simplifies the task for developers and helps ensure that settlements are processed efficiently and accurately. ```mermaid graph LR subgraph PSP1 [PSP 1 Adapter] direction LR C1("Transaction 1") --> S1["Settlement 1 CSV"] C2("...") --> S1 end subgraph PSP2 [PSP 2 Adapter] direction LR C3("Transaction 2") --> S2["Settlement 2 XML"] C4("...") --> S2 end subgraph PPE [IXOPAY platform post-processing engine] direction LR S1 --> DF1("Data fetcher 1") S2 --> DF2("Data fetcher 2") DF1 --> SP("Settlement post-processing") DF2 --> SP("Settlement post-processing") end SP -->|"HTTP POST,\ne-mail,\nupload: SFTP, OneDrive, S3"| M("Merchant") M -->|"Settlement API"| SP ``` It is important to note that settlement information may not be immediately available and can take different amounts of time to be provided by different PSPs. Developers should be prepared to handle delays in settlement information and ensure that their systems are designed to process settlements as efficiently as possible. After the settlement data has been processed, it can be configured to be exported in various ways. Settlement data can be sent to an HTTP endpoint, sent via email, uploaded to SFTP, OneDrive or S3, or pulled via the [Settlement API](https://documentation.ixopay.com/api/settlement/settlement-api). This settlement data can then be imported into the accounting system used by the merchant. For more detailed information on managing settlements and resolving conflicts, consult the IXOPAY platform [User Manual](https://docs.ixopay.com/en/platform-user-administration-manual/post-processing/provider-settlements). ## Settlement API The [Settlement API](https://documentation.ixopay.com/api/settlement/settlement-api) can be used to fetch settlement files that were generated via settlement post-processing steps: * curl * Python * PHP * Java ```sh curl --request POST -sL \ --url "https://gateway.ixopay.com/api/settlement/getSettlementFiles" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header "Authorization: Basic $(echo -n "$USERNAME:$PASSWORD" | base64)" \ --data-raw '{ "fromDate": "2023-04-01T00:00:00Z", "toDate": "2023-04-30T23:59:59Z", "format": "link" }' ``` ```python import requests import json import base64 import os url = "https://gateway.ixopay.com/api/settlement/getSettlementFiles" auth = base64.b64encode("%s:%s" % (os.environ["USERNAME"], os.environ["PASSWORD"])) payload = json.dumps( { "fromDate": "2023-04-01T00:00:00Z", "toDate": "2023-04-30T23:59:59Z", "format": "link" } ) headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Basic {auth}".format(auth=auth), } response = requests.request("POST", url, headers=headers, data=payload) ``` ```php "https://gateway.ixopay.com/api/settlement/getSettlementFiles", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => << array( 'Content-Type: application/json', 'Accept: application/json', "Authorization: Basic $auth" ), )); $response = curl_exec($curl); curl_close($curl); ``` ```java OkHttpClient client = new OkHttpClient().newBuilder().build(); RequestBody body = RequestBody.create( MediaType.parse("application/json"), "{" + "\"fromDate\": \"2023-04-01T00:00:00Z\"," + "\"toDate\": \"2023-04-30T23:59:59Z\"," + "\"format\": \"link\"" + "}" ); String auth = Base64.getEncoder().encodeToString( "%s:%s".format(System.getenv("USERNAME"), System.getenv("PASSWORD"))); Request request = new Request.Builder() .url("https://gateway.ixopay.com/api/settlement/getSettlementFiles") .method("POST", body) .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .addHeader("Authorization", "Basic %s".format(auth)) .build(); Response response = client.newCall(request).execute(); ```