Whitelabel
Embed regulated euro accounts and SEPA payments in your product under your own brand. Each customer gets a dedicated IBAN and on-chain address; your users interact only with your app, never with Monerium.
Create an application
- Go to sandbox.monerium.dev and select Developers in the sidebar.
- Click Create application and select Whitelabel.
- Enter your application name and confirm.
- Copy the CLIENT ID and CLIENT SECRET from the credentials screen; you'll need both for the client credentials flow below.
When you're ready for production, repeat this at monerium.app. See Going live for the full checklist.
Integration flow
- Authenticate: Obtain an access token using Client Credentials.
- Set up webhooks: Register your endpoint to receive events for profile approvals, IBAN provisioning, and payments.
- Onboard the customer: Create a profile and submit identity data via KYC Sharing or KYC/KYB Reliance. Monitor approval via
profile.updatedwebhooks. Monerium may also request source of funds after submission based on risk evaluation: you'll receive aprofile.updatedwebhook with the profile back inincompleteand asourceOfFundsverification added inincomplete— collect the documents and submit them viaPATCH /profiles/{profileId}/verificationsto resume approval. - Link a wallet: Associate a blockchain address with the profile using a cryptographic proof of ownership.
- Issue an IBAN: Provision a dedicated IBAN once the profile is approved and a wallet is linked.
- Send and receive payments: Place redeem orders for outgoing SEPA payments and cross-chain transfers. Incoming payments are handled automatically.
Authentication
Use the CLIENT ID and CLIENT SECRET from your application credentials to request an access token.
Request tokens by posting your credentials to:
const response = await fetch('https://api.monerium.dev/auth/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
grant_type: 'client_credentials',
client_id: 'YOUR_CLIENT_ID',
client_secret: 'YOUR_CLIENT_SECRET',
}),
});
const { access_token, expires_in } = await response.json();
// {
// access_token: "EoWmpc2uSZar6h2bKgh",
// expires_in: 3600,
// token_type: "Bearer"
// }
Store the access token and include it as Authorization: Bearer <token> on every API request. It expires after 1 hour; when it does, repeat this request to get a new one.
Your backend should handle the token exchange and make all Monerium API calls. Never expose your client_secret or access token to frontend code.
Webhooks
Most steps in the Whitelabel flow are asynchronous — profile approvals, IBAN provisioning, payment processing. Webhooks let your backend react to these events without polling.
- Generate a secret and register your endpoint. Create a random 24–64 byte value, base64-encode it, and prefix it with
whsec_. Then post it along with your URL to:
- Node.js
- Go
import crypto from 'crypto';
const secret = 'whsec_' + crypto.randomBytes(32).toString('base64');
const response = await fetch('https://api.monerium.dev/webhooks', {
method: 'POST',
headers: {
Authorization: `Bearer ${access_token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://your-app.com/webhooks/monerium',
secret,
types: [
'profile.updated',
'profile.error',
'iban.updated',
'order.created',
'order.updated',
],
}),
});
// Store `secret` — you need it to verify incoming requests
import (
"bytes"
"crypto/rand"
"encoding/base64"
"encoding/json"
"net/http"
)
raw := make([]byte, 32)
rand.Read(raw)
secret := "whsec_" + base64.StdEncoding.EncodeToString(raw)
body, _ := json.Marshal(map[string]any{
"url": "https://your-app.com/webhooks/monerium",
"secret": secret,
"types": []string{"profile.updated", "profile.error", "iban.updated", "order.created", "order.updated"},
})
req, _ := http.NewRequest("POST", "https://api.monerium.dev/webhooks", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+accessToken)
req.Header.Set("Content-Type", "application/json")
// Store `secret` — you need it to verify incoming requests
-
Confirm the subscription — Monerium sends a
subscription.createdevent to your URL immediately after registration. Respond with200 OKto activate it. -
Handle incoming events. Verify the signature, return
200 OKimmediately, then process the event asynchronously. Each request includes awebhook-signatureheader with an HMAC-SHA256 signature over thewebhook-id,webhook-timestamp, and raw request body:
- Node.js
- Go
import crypto from 'crypto';
app.post(
'/webhooks/monerium',
express.raw({ type: 'application/json' }),
async (req, res) => {
const id = req.headers['webhook-id'];
const timestamp = req.headers['webhook-timestamp'];
const signature = req.headers['webhook-signature'];
const signed = `${id}.${timestamp}.${req.body}`;
const expected = crypto
.createHmac('sha256', Buffer.from(SECRET.replace('whsec_', ''), 'base64'))
.update(signed)
.digest('base64');
if (signature !== `v1,${expected}`) {
return res.sendStatus(401);
}
res.sendStatus(200);
if (await hasProcessed(id)) {
return; // already handled, skip
}
processEvent(JSON.parse(req.body)); // handle asynchronously
}
);
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
"net/http"
"strings"
)
func webhookHandler(w http.ResponseWriter, r *http.Request) {
body, _ := io.ReadAll(r.Body)
id := r.Header.Get("webhook-id")
timestamp := r.Header.Get("webhook-timestamp")
signature := r.Header.Get("webhook-signature")
key, _ := base64.StdEncoding.DecodeString(strings.TrimPrefix(secret, "whsec_"))
signed := fmt.Sprintf("%s.%s.%s", id, timestamp, body)
mac := hmac.New(sha256.New, key)
mac.Write([]byte(signed))
expected := "v1," + base64.StdEncoding.EncodeToString(mac.Sum(nil))
if signature != expected {
http.Error(w, "unauthorized", http.StatusUnauthorized)
return
}
w.WriteHeader(http.StatusOK)
if hasProcessed(id) {
return // already handled, skip
}
go processEvent(body) // handle asynchronously
}
Event types
| Event | When it fires |
|---|---|
profile.updated | Profile details or state changed |
profile.error | KYC profile data was rejected as invalid and skipped during ingestion |
iban.updated | IBAN details or state changed |
order.created | New order placed |
order.updated | Order state changed |
profile.error is opt-in — add it to the types array when creating or updating a subscription. It is not included by default. The payload lists the field(s) that were rejected and the reason; the profile stays incomplete until the invalid data is corrected and resubmitted.
Retries
If your endpoint does not return 200 OK, Monerium retries up to 10 times over 12 hours using exponential backoff. Retried events carry the same webhook-id as the original — store processed IDs to avoid handling the same event twice.