Skip to content

Mint: issue MYRT

Mint converts confirmed MYR into MYRT delivered to a wallet address.

POST/v1/mintsmint:create
bash
curl -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
  }'
ts
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}`);
python
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

FieldTypeRequiredNotes
referenceIdstringyesYour unique handle for this order. See reference IDs
amountMyrstringyesPositive decimal, at most 6 decimal places
walletAddressstringyesChecksummed EVM address that receives MYRT
customerIdstringyesA MYRT customer you have linked to your integration
chainIdnumbernoDefaults to the active chain. See network configuration
fiatConfirmedbooleannotrue 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

json
{
  "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

GET/v1/mints/{referenceId}mint:read

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.

bash
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

POST/v1/mints/{referenceId}/cancelmint:createPlanned

Planned

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

CodeHTTPWhen
INVALID_AMOUNT400amountMyr is not a positive decimal with at most 6 decimal places
INVALID_WALLET_ADDRESS400walletAddress is not a valid EVM address
INVALID_REFERENCE_ID400referenceId fails the format rule
AMOUNT_BELOW_FLOOR400Below the minimum mint amount
FOREIGNER_LIMIT_EXCEEDED400Above the per-transaction cap for a non-resident customer
CUSTOMER_NOT_VERIFIED403The customer has not cleared verification
SCOPE_DENIED403fiatConfirmed: true on a key without mint:execute
IDEMPOTENCY_CONFLICT409Same Idempotency-Key, different body
ORDER_NOT_CANCELLABLE409Cancel requested after the order was submitted for settlement
SETTLEMENT_FAILED502Custody submission failed. Retry with the same idempotency key

The full list is on the errors page.

MYRT is a 1:1 Ringgit-backed stablecoin on Ethereum.