Quick start
Create a sandbox payment link, simulate payment, and receive a webhook.
Quick start
This walkthrough uses Sandbox. You need a company account on Momen with Developer settings enabled.
1. Get a sandbox secret key
- Open Settings → Developer.
- Switch mode to Sandbox.
- Create a secret key. It starts with
sk_test_. - Copy it immediately — Momen shows the full key once.
2. Connect an account
Under Settings → Developer, connect at least one account to the key. GET /accounts only returns accounts that key may access.
curl https://stggateway-sandbox.momen.co/v1/accounts \-H "Authorization: Bearer sk_test_YOUR_KEY"3. Create a payment link
Amounts are integer rupiah (no decimals). Send an Idempotency-Key on every create.
curl -X POST https://stggateway-sandbox.momen.co/v1/payment-links \-H "Authorization: Bearer sk_test_YOUR_KEY" \-H "Content-Type: application/json" \-H "Idempotency-Key: 8f14e45f-ceea-467a-9575-8f14e45fceea" \-d '{ "amount": 150000, "title": "Invoice #1042"}'A successful response is 201 with data.url (checkout) and data.id.
Sandbox checkout pages cannot be opened yet. Drive outcomes with /sandbox/simulate instead of paying in a browser.
4. Simulate payment
curl -X POST https://stggateway-sandbox.momen.co/v1/sandbox/simulate \-H "Authorization: Bearer sk_test_YOUR_KEY" \-H "Content-Type: application/json" \-d '{ "payment_link_id": "PAYMENT_LINK_UUID", "event": "paid"}'paid settles the link and queues payment_link.succeeded to your webhook URL.
5. Receive the webhook
Configure your webhook URL under Settings → Developer. Verify every delivery with the whsec_ token — see Webhooks.
Try it in the docs
Open List connected accounts in the API reference, paste a sk_test_ key, and send the request from your browser. Requests go straight to the sandbox API — never through a docs proxy.