Mint: issue MYRT
Mint converts confirmed MYR into MYRT delivered to a wallet address.
/v1/mintscurl -X POST https://sandbox-api.myrt.money/v1/mints \
-H "Authorization: Bearer $MYRT_API_KEY" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json" \
-d '{
"referenceId": "acme:mint:2026-09-10:00417",
"amountMyr": "1000.00",
"walletAddress": "0xAbC0000000000000000000000000000000000001",
"customerId": "cus_9f2a3b4c",
"fiatConfirmed": false
}'import { randomUUID } from "node:crypto";
const res = await fetch("https://sandbox-api.myrt.money/v1/mints", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MYRT_API_KEY}`,
"Idempotency-Key": randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
referenceId: "acme:mint:2026-09-10:00417",
amountMyr: "1000.00",
walletAddress: "0xAbC0000000000000000000000000000000000001",
customerId: "cus_9f2a3b4c",
fiatConfirmed: false,
}),
});
const order = await res.json();
if (!order.ok) throw new Error(`${order.error.code}: ${order.error.message}`);import os, uuid, requests
res = requests.post(
"https://sandbox-api.myrt.money/v1/mints",
headers={
"Authorization": f"Bearer {os.environ['MYRT_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"referenceId": "acme:mint:2026-09-10:00417",
"amountMyr": "1000.00",
"walletAddress": "0xAbC0000000000000000000000000000000000001",
"customerId": "cus_9f2a3b4c",
"fiatConfirmed": False,
},
timeout=30,
)
order = res.json()
if not order["ok"]:
raise RuntimeError(f"{order['error']['code']}: {order['error']['message']}")Request fields
| Field | Type | Required | Notes |
|---|---|---|---|
referenceId | string | yes | Your unique handle for this order. See reference IDs |
amountMyr | string | yes | Positive decimal, at most 6 decimal places |
walletAddress | string | yes | Checksummed EVM address that receives MYRT |
customerId | string | yes | A MYRT customer you have linked to your integration |
chainId | number | no | Defaults to the active chain. See network configuration |
fiatConfirmed | boolean | no | true only once MYR has actually settled |
fiatConfirmed is the money gate
Send false to record the intent while your payment is still in flight. Send true, on a key holding mint:execute, only after settlement is irreversible. MYRT is never issued ahead of fiat.
The typical shape is two calls: create with fiatConfirmed: false when the customer initiates, then confirm once your bank webhook fires. Both calls carry the same referenceId.
Response
201 Created
{
"ok": true,
"referenceId": "acme:mint:2026-09-10:00417",
"status": "payment_pending",
"phase": "PAYMENT_PENDING",
"direction": "MINT",
"chainId": 1,
"network": "Ethereum",
"tokenAddress": "0x...",
"walletAddress": "0xAbC0000000000000000000000000000000000001",
"amounts": {
"myr": "1000.00",
"myrt": "1000.00",
"feeMyr": "1.00",
"amountRaw": "1000000000",
"decimals": 6
},
"blockchain": { "txHash": null, "blockNumber": null },
"timestamps": { "createdAt": "2026-09-10T04:12:33.918Z", "updatedAt": null }
}Fees are quoted server-side and returned on the order. Do not compute them client-side. For a mint, myrt equals myr. feeMyr is the payment rail charge recorded on the order and does not reduce the MYRT issued.
status and phase are explained in core concepts. Drive your business logic from status.
Reading status
/v1/mints/{referenceId}Returns the same object with updated status, phase, and blockchain.txHash. An order reaches completed only after the chain's confirmation count, so do not treat a transaction hash as final on its own.
curl https://sandbox-api.myrt.money/v1/mints/acme:mint:2026-09-10:00417 \
-H "Authorization: Bearer $MYRT_API_KEY"Polling works. Webhooks are preferred for settlement events.
Cancelling before settlement
/v1/mints/{referenceId}/cancelPlanned
This is part of the v1 contract and is documented ahead of release. It is not yet served in production. Build against it only once this notice is gone.
Cancels a mint order that has not yet been submitted for settlement. The order then reports status: "cancelled". An order that has already been submitted cannot be cancelled.
Errors you should handle
| Code | HTTP | When |
|---|---|---|
INVALID_AMOUNT | 400 | amountMyr is not a positive decimal with at most 6 decimal places |
INVALID_WALLET_ADDRESS | 400 | walletAddress is not a valid EVM address |
INVALID_REFERENCE_ID | 400 | referenceId fails the format rule |
AMOUNT_BELOW_FLOOR | 400 | Below the minimum mint amount |
FOREIGNER_LIMIT_EXCEEDED | 400 | Above the per-transaction cap for a non-resident customer |
CUSTOMER_NOT_VERIFIED | 403 | The customer has not cleared verification |
SCOPE_DENIED | 403 | fiatConfirmed: true on a key without mint:execute |
IDEMPOTENCY_CONFLICT | 409 | Same Idempotency-Key, different body |
ORDER_NOT_CANCELLABLE | 409 | Cancel requested after the order was submitted for settlement |
SETTLEMENT_FAILED | 502 | Custody submission failed. Retry with the same idempotency key |
The full list is on the errors page.
