Quickstart
From an approved account to a live pop-up taking your first payment, in six steps.
The six steps#
- 1
Sign in and create an API key
In the console, open Integration → API keys and create a key with a label such as
production. The secret is shown exactly once. Store it in your secrets manager; the console can only ever show you the key id afterwards. - 2
Prove the key works
Call
GET /partner/v1/pingwith the key. The response names your company and the key id it resolved to, plus our server time so you can check your clock before you send anything that moves money. - 3
Link a customer
Every person you act for has to be linked to your company first.
POST /partner/v1/payments/customerswith their Roblox username or id and, ideally, your ownexternalReffor them. From then on any of those identifiers works as acustomerRef. - 4
Open a session and embed the pop-up
Your server calls
POST /partner/v1/payments/sessionsfor that customer and passes the returnedtokentoMM2Payments.open(...)on your page. Your user sells inside the pop-up. - 5
Receive the webhook
Set an endpoint under MM2 Payments → Integration. Every completed payment arrives as a signed
payment.completedevent, and the order it belongs to asorder.completed. Credit your user from those, not from the pop-up's callback. - 6
Turn buying on
A new company starts with MM2 Payments switched off: the pop-up loads but refuses every sale until an owner turns buying on under MM2 Payments → Pool. Do that last, once your webhook receiver is live.
1. Ping#
curl https://api.mm2empire.com/partner/v1/ping \
-H "X-Partner-Key: $MM2_PARTNER_KEY"{
"partnerSlug": "wild-trading-co",
"partnerName": "Wild Trading Co",
"keyId": "pk_live_3f9a…",
"serverTime": "2026-09-05T13:20:11.482910+00:00"
}2. Link a customer#
curl -X POST https://api.mm2empire.com/partner/v1/payments/customers \
-H "X-Partner-Key: $MM2_PARTNER_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "robloxUsername": "xXShadowXx", "externalRef": "user_48213" }'Send either robloxUsername or robloxId, never both. externalRef is your own id for the person; it must be unique within your company and it is what you will most often pass as customerRef later. Linking the same person twice simply refreshes the stored username.
3. Open a session and show the pop-up#
const response = await fetch('https://api.mm2empire.com/partner/v1/payments/sessions', {
method: 'POST',
headers: {
'X-Partner-Key': process.env.MM2_PARTNER_KEY,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
customerRef: 'user_48213', // your externalRef, their Roblox id, or their username
orderId: 'dep_9f2c1', // your own id for this top-up, echoed on every webhook
metadata: { source: 'wallet' }, // flat key/value, up to 20 keys
}),
})
const session = await response.json()
// Hand session.token to the browser. Never hand it the API key.<script src="https://partner.mm2empire.com/embed.js"></script>
<script>
MM2Payments.open({
token: sessionToken,
onComplete: payment => console.log('sold', payment),
onClose: () => refreshBalance(),
})
</script>What next#
- Decide how MM2 Payments is funded. The default needs no float and no pricing.
- Read the webhook guide and verify signatures before you rely on an event.
- If you also pay users out in items, continue with MM2 Payouts.
- Connect a Discord channel so your team sees activity without watching the console.