Skip to content

📖 MyanMyanPay API Documentation

This document details the public API endpoints used to initiate payment requests.

🔑 Authentication

All requests to the endpoints must be authenticated using the appropriate Publishable Key (for production) or Sandbox Key (for testing).

  • Method: HTTP Header
  • Header: Authorization: Bearer <Your_Publishable_Key_or_Sandbox_Key>
  • Header: X-Mmpay-Nonce: Use our SDK, secrets...
  • Header: X-Mmpay-Signature: Use our SDK, secrets...
  • Header: Content-Type: application/json

1. Create Production Payment Request

This endpoint is used for initiating live, production payment transactions.

POST /payments/create

Detail Description
Endpoint /payments/create
Method POST

Request Body (payload structure)

The request body should be a JSON object containing the transaction details. Based on your IPTrx interface, the required fields are:

Field Type Required Description Example
orderId string Yes Your generated order ID for the order or system initiating the payment. "ORD-3983833"
amount number Yes The total transaction amount. 1500.50
callbackUrl string No The URL where the payment gateway will send transaction status updates. "https://yourserver.com/webhook"
currency string No The currency code (e.g., 'MMK'). "MMK"
items Array<Object> No List of items included in the purchase. [{name: "Hat", amount: 1000, quantity: 1}]

items Object Structure

Field Type Description
name string The name of the item.
amount number The unit price of the item.
quantity number The number of units purchased.

Response Codes

Code Status Description
201 Created Transaction initiated successfully. Response contains QR code URL/details.
401 Unauthorized Invalid or missing Publishable Key.
400 Bad Request Missing required body fields (validated by schema, if implemented).
503 Service Unavailable Upstream payment API failed or is unreachable.
500 Internal Server Error General server error during payment initiation.

Successful Response (201) Example

{
  "orderId": "_trx_0012345",
  "amount": 2800,
  "currency": "MMK",
  "qr": "base64:StringxxxIt_Is_A_QR_Code",
  "status": "PENDING"
}

2. Create Sandbox/Test Payment Request

This endpoint is used for initiating test, non-monetary transactions during development.

POST /payments/test-create

Detail Description
Endpoint /payments/test-create
Method POST

Request Body (payload structure)

The request body should be a JSON object containing the transaction details. Based on your IPTrx interface, the required fields are:

Field Type Required Description Example
orderId string Yes Your generated order ID for the order or system initiating the payment. "ORD-3983833"
amount number Yes The total transaction amount. 1500.50
callbackUrl string No The URL where the payment gateway will send transaction status updates. "https://yourserver.com/webhook"
currency string Yes The currency code (e.g., 'MMK'). "MMK"
items Array<Object> No List of items included in the purchase. [{name: "Hat", amount: 1000, quantity: 1}]

items Object Structure

Field Type Description
name string The name of the item.
amount number The unit price of the item.
quantity number The number of units purchased.

Response Codes

Code Status Description
201 Created Transaction initiated successfully. Response contains QR code URL/details.
401 Unauthorized Invalid or missing Publishable Key.
400 Bad Request Missing required body fields (validated by schema, if implemented).
503 Service Unavailable Upstream payment API failed or is unreachable.
500 Internal Server Error General server error during payment initiation.

Successful Response (201) Example

{
  "orderId": "_trx_0012345",
  "amount": 2800,
  "currency": "MMK",
  "qr": "base64:StringxxxIt_Is_A_QR_Code",
  "status": "PENDING"
}

Handling callbacks

Incoming HTTP POST Parameters

Header

Field Name Type Required Description
Content-Type string Yes 'application/json'
X-Mmpay-Signature string Yes '34834890vfgh9hnf94irfg_48932i4rt90349849'
X-Mmpay-Nonce string Yes '94843943949349'

Body

Field Name Type Required Description
orderId string Yes Unique identifier for the specific order.
amount number Yes The transaction amount.
currency string Yes The 3-letter currency code (e.g., MMK, USD).
vendor string Yes Identifier for the vendor initiating the request.
method 'QR', 'PIN', 'PWA', 'CARD' Yes Identifier for the method.
status 'PENDING','SUCCESS','FAILED','REFUNDED' Yes Current status of the transaction.
transactionRefId string Yes The reference ID generated by the payment provider.
callbackUrl string No Optional URL to receive webhooks or updates.
customMessage string No User provided custom message

Error Codes

BROWSER SDK Users
Code Description
R000 Internal Server Error ( Talk to our support immediately fot this )
R001 Bearer Token Not Included In Your Request
R002 Key Not 'LIVE'
R003 Origin Not Whitelisted
R004 Origin Requires SSL
429 Ratelimit hit only 1000 request / minute allowed
Api Key Layer Authentication [SERVER SDK]
Code Description
KA0001 Bearer Token Not Included In Your Request
KA0002 API Key Not 'LIVE'
KA0003 Signature mismatch
KA0004 Internal Server Error ( Talk to our support immediately fot this )
KA0005 IP Not whitelisted
429 Ratelimit hit only 1000 request / minute allowed
JWT Layer Authentication [SERVER SDK]
Code Description
BA001 Btoken is nonce one time token is not included
BA002 Btoken one time nonce mismatch
BA000 Internal Server Error ( Talk to our support immediately fot this )
429 Ratelimit hit only 1000 request / minute allowed