BTM File - Usage & Requirements
Use this guide to submit payment files to the BTM endpoint as a raw/binary request body (not multipart/form-data). It describes the required headers, query parameters, supported channels, sample requests (Python, cURL, Postman), and common pitfalls
Overview
The BTM file upload endpoint expects the payment file as a raw stream in the HTTP request body. Multipart uploads are not supported. For the mapping engine channel (_btm.mappingEngine), you must also provide a file-format indicating the actual payment schema (PAIN_001_001_03) rather than a MIME type.
Endpoint
POST https://api-mtls.eu.tispayments.com/rest/api/btm/files
Transport / Security
TLS: Mutual TLS (mTLS) with a client certificate is required.
More details can be found on https://api-docs.tispayments.com/docs/getting-started#mutual-tls
Host: api-mtls.eu.tispayments.com
Configure your client certificate in your HTTP client/tooling (Postman Certificates or cURL --cert/--key).
Required Headers
| Header | Value | Required | Notes |
|---|---|---|---|
Accept | application/json | Yes | Response is JSON. |
Content-Type | text/xml or application/octet-stream | Yes | Use text/xml for XML payment files; application/octet-stream is acceptable for generic binary payloads. Do not send duplicate Content-Type headers. |
TIS-API-MODE | BTM | When using BTM engine | Required when calling the BTM engine. |
Important: Some clients (Postman) can auto-set
Content-Type. Ensure you have exactly one Content-Type header. Duplicate entries can cause empty or malformed payloads.
Query Parameters
Place the following parameters on the query string
| Name | Type | Required | Applies To | Description |
|---|---|---|---|---|
file-name | string | Yes | All channels | Original file name (your_file.xml) |
client-system-id | string | Yes | All channels | Your system ID |
channel | string | Yes | All channels | Target processing channel (_btm.mappingEngine) |
file-format | string | Yes for _btm.mappingEngine | _btm.mappingEngine | Payment format identifier for in-mapping (PAIN_001_001_03). This is not a MIME type. Must match actual file content |
For _btm.mappingEngine, file-format must correspond to the specific payment scheme/version contained in the file (
PAIN_001_001_03,PAIN_001_001_06, etc.).
Request Body Format
- Body: the raw file contents as the request body (binary stream).
- Do not wrap the file in multipart form-data (no boundaries, no part headers).
Examples
✅ Python (correct: raw/binary upload)
import requests
url = "https://api-mtls.eu.tispayments.com/rest/api/btm/files"
headers = {
"accept": "application/json",
"content-type": "text/xml",
"TIS-API-MODE": "BTM"
}
params = {
"file-name": "your_file.xml",
"client-system-id": "your-system-id",
"channel": "_btm.mappingEngine",
"file-format": "PAIN_001_001_03"
}
with open("your_file.xml", "rb") as f:
resp = requests.post(url, headers=headers, params=params, data=f)
print(resp.status_code)
print(resp.text)✅ cURL — correct binary upload
curl -X POST "https://api-mtls.eu.tispayments.com/rest/api/btm/files?file-name=your_file.xml&client-system-id=your-system-id&channel=_btm.mappingEngine&file-format=PAIN_001_001_03" \
-H "Accept: application/json" \
-H "Content-Type: text/xml" \
-H "TIS-API-MODE: BTM" \
--data-binary "@your_file.xml" \
--cert /path/to/client.crt --key /path/to/client.key❌ Python — incorrect multipart (unsupported)
# WRONG: using `files=` sends multipart/form-data
import requests
url = "https://api-mtls.eu.tispayments.com/rest/api/btm/files"
headers = {"accept": "application/json"}
params = {
"file-name": "your_file.xml",
"client-system-id": "your-system-id",
"channel": "_btm.mappingEngine",
"file-format": "PAIN_001_001_03"
}
with open("your_file.xml", "rb") as file:
files = {"file": ("your_file.xml", file, "text/xml")}
response = requests.post(url, headers=headers, params=params, files=files) # WRONGPostman Instructions
- Method:
POST - URL: https://api-mtls.eu.tispayments.com/rest/api/btm/files
- Params tab: add
file-name,client-system-id,channel, and (if using _btm.mappingEngine)file-format. - Headers tab:Accept: application/json
- Content-Type:
text/xml(exactly one!) - TIS-API-MODE:
BTM1.Body tab: select binary, then choose your file. Do not use form-data.
- Content-Type:
- Certificates (mTLS): configure your client certificate in Postman Settings → Certificates and map it to api-mtls.eu.tispayments.com.
- Send the request.
Common pitfall: Having two
Content-Typeheaders stops Postman from applying the correct content-type forbinarybodies and may result in empty files server-side.
FAQ
Q: Why can’t I use multipart/form-data?
A: The endpoint reads the request body as a raw stream. Multipart adds boundaries and part headers that are not parsed by this service.
Q: Which Content-Type should I use?
A: Use text/xml for XML payment files. application/octet-stream is acceptable for generic binary payloads. Do not set multiple Content-Type headers.
Q: What should I put in file-format?
A: The payment format identifier (PAIN_001_001_03), not a MIME type. It must match the actual file content for correct in-mapping.
Updated about 18 hours ago
