Do you have example code?
Yes. The API is a standard HTTP service: any language that can send a JSON POST request with HTTP Basic authentication can use it. Thereβs no SDK to install.
Two things to keep in mind, whatever the language:
- Authentication: the API key is the username and the password is left blank.
- Response: the SEPA XML arrives Base64-encoded in the
filefield; you just decode it.
The API reference also generates ready-to-copy snippets in several languages (curl, Python, Node.js, PHP, Ruby and more).
Python example
import base64
import requests
r = requests.post(
"https://api.generatesepa.com/api/v2/sdd",
auth=("YOUR_API_KEY", ""),
json={
"name": "Acme Services Ltd",
"iban": "IE29AIBK93115212345678",
"sepa_identifier": "IE84ZZZ123456",
"debits": [{
"name": "John Smith",
"iban": "IE64IRCE92050112345678",
"amount": 2599, # in cents
"date": "2026-12-05",
"description": "December subscription",
"reference": "INV-2026-120",
"mandate_reference": "MNDT-000123",
"mandate_signature": "2026-01-15",
}],
},
)
if r.status_code != 201:
raise SystemExit(r.json())
with open("direct-debits.xml", "wb") as f:
f.write(base64.b64decode(r.json()["file"]))
Node.js example (18 or later)
const auth = Buffer.from("YOUR_API_KEY:").toString("base64");
const res = await fetch("https://api.generatesepa.com/api/v2/sct", {
method: "POST",
headers: { "Authorization": `Basic ${auth}`, "Content-Type": "application/json" },
body: JSON.stringify({
name: "Acme Services Ltd",
iban: "IE29AIBK93115212345678",
payments: [{
name: "Murphy Supplies Ltd",
iban: "IE64IRCE92050112345678",
amount: 125000, // in cents
date: "2026-12-05",
description: "Invoice F-2026-311",
reference: "PAY-311",
}],
}),
});
const data = await res.json();
if (res.status !== 201) throw new Error(JSON.stringify(data));
const xml = Buffer.from(data.file, "base64").toString("utf8");
Conclusion
Adapt one of these examples to your language: a POST request, Basic authentication and a Base64 decode are all it takes.