Quickstart

From an approved account to a live pop-up taking your first payment, in six steps.

On this page

The six steps#

  1. 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. 2

    Prove the key works

    Call GET /partner/v1/ping with 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. 3

    Link a customer

    Every person you act for has to be linked to your company first. POST /partner/v1/payments/customers with their Roblox username or id and, ideally, your own externalRef for them. From then on any of those identifiers works as a customerRef.

  4. 4

    Open a session and embed the pop-up

    Your server calls POST /partner/v1/payments/sessions for that customer and passes the returned token to MM2Payments.open(...) on your page. Your user sells inside the pop-up.

  5. 5

    Receive the webhook

    Set an endpoint under MM2 Payments → Integration. Every completed payment arrives as a signed payment.completed event, and the order it belongs to as order.completed. Credit your user from those, not from the pop-up's callback.

  6. 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
curl https://api.mm2empire.com/partner/v1/ping \
  -H "X-Partner-Key: $MM2_PARTNER_KEY"
200 OK
{
  "partnerSlug": "wild-trading-co",
  "partnerName": "Wild Trading Co",
  "keyId": "pk_live_3f9a…",
  "serverTime": "2026-09-05T13:20:11.482910+00:00"
}

3. Open a session and show the pop-up#

Your server (Node)
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.
Your page
<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#