MIA POS ecomm API (0.1.1)

Download OpenAPI specification:Download

API providing the ability to receive online payments using the MIA pos protocol

  1. Parameters for accessing the API: Merchant receives his unique merchantId and secretKey to gain access to the MIA POS API
  2. Obtaining an access token: Perform a request POST /ecomm/api/v1/token to obtain ecomm API access tokens. To receive tokens you need to use the parameters obtained in the 1st step
  3. Refresh access token: Perform a request POST /ecomm/api/v1/token/refresh to get a new access token based on the refresh token.
  4. Create a payment request: Perform a request POST /ecomm/api/v1/pay to create a request to pay for an order through the mia pos system.
  5. Redirecting client to checkout page: Client must be redirected to the link received in the 4th step in the property checkoutPage.
  6. Redirect to result URL: MIA pos system will redirect the user to the success or fail merchant URL depending on the payment result
  7. Checking the payment result: Perform a request GET /ecomm/api/v1/payment/{paymentId} to check the payment result
  8. Sending signed result: MIA POS will send the order payment result to the URL specified in the callbackUrl parameter when creating a payment request
  9. Verifying the signature of the received data: merchant can issue a GET /api/v1/public-key request to obtain a public key with which to verify the signature of the miaPOS system.

tokens

Generate access tokens by credentials

Request to obtain a token to access ecomm API using merchant credentials

Request Body schema: application/json
required

Merchant credentials for receiving tokens

merchantId
string

Unique merchant identifier in the MIA POS system

secretKey
string

Merchant secret key within the MIA POS system

Responses

Request samples

Content type
application/json
{
  • "merchantId": "string",
  • "secretKey": "H7rwtECx2EtAbnpkZ2DrfCOE52hxBdjp"
}

Response samples

Content type
application/json
{
  • "accessToken": "string",
  • "accessTokenExpiresIn": 0,
  • "refreshToken": "string",
  • "refreshTokenExpiresIn": 0,
  • "tokenType": "Bearer"
}

Updating the access token

Updating a pair of tokens based on a refresh token

Request Body schema: application/json
required

Data for refreshing access tokens

refreshToken
string

Refresh token based on which you need to get a new pair of tokens

Responses

Request samples

Content type
application/json
{
  • "refreshToken": "string"
}

Response samples

Content type
application/json
{
  • "accessToken": "string",
  • "accessTokenExpiresIn": 0,
  • "refreshToken": "string",
  • "refreshTokenExpiresIn": 0,
  • "tokenType": "Bearer"
}

ecomm-pay

Registering a payment request

Registers information about a purchase that must be paid using the mia pos terminal. Payment will go through the checkout page. To start the payment process, the user must be redirected to checkoutPage, which will be returned in the response

Authorizations:
bearerAuth
Request Body schema: application/json
required

Information about the purchase that must be paid using mia pos

terminalId
required
string

Merchant terminal ID that must be used to generate a payment request. Ecomm terminal is transmitted in the case of payment via QR, or the RTP terminal in the case of RTP payment

orderId
required
string

Unique order number on the merchant side

amount
required
number <double>

Amount for which you need to generate a payment request

currency
required
string

Payment currency. Currently always MDL

language
string
Enum: "en" "ro" "ru"

Language of the checkout page. Default value: ro

payDescription
required
string

Description of the payment that will be displayed to the user on the checkout page

paymentType
string
Default: "qr"
Enum: "rtp" "qr"

Available payment types via ecomm protocol MIA POS

clientName
string

First name, last name of the client making the payment

clientPhone
string

Phone number of the client making the payment. Is required for payment type rtp

clientEmail
string

Email of the client making the payment

callbackUrl
string

Merchant link to which information about the transaction payment result will be sent. If not passed, the link set in AdminUI will be used

successUrl
string

Link to the merchant resource where the user will be redirected as a result of successful payment. If not passed, the link set in AdminUI will be used

failUrl
string

Link to the merchant resource where the user will be redirected as a result of an unsuccessful payment. If not passed, the link set in AdminUI will be used

Responses

Request samples

Content type
application/json
{
  • "terminalId": "TRM0001223",
  • "orderId": "string",
  • "amount": 145.25,
  • "currency": "MDL",
  • "language": "en",
  • "payDescription": "string",
  • "paymentType": "qr",
  • "clientName": "string",
  • "clientPhone": "79000001",
  • "clientEmail": "string",
  • "callbackUrl": "string",
  • "successUrl": "string",
  • "failUrl": "string"
}

Response samples

Content type
application/json
{}

Registering a request to pay

Sends a direct payment request to the user, bypassing intermediate checkout pages tracking payment statuses

Authorizations:
bearerAuth
Request Body schema: application/json
required

Information about the payment request that needs to be sent to the user

terminalId
required
string

Merchant terminal ID that must be used to generate a payment request. Must support RTP payments.

orderId
required
string

Unique order number on the merchant side

amount
required
number <double>

Amount for which you need to generate a payment request

currency
required
string

Payment currency. Currently always MDL

payDescription
required
string

Description of the payment that will be displayed to the user on the checkout page

clientName
required
string

First name, last name of the client making the payment

clientPhone
required
string

Phone number of the client making the payment

clientEmail
string

Email of the client making the payment

callbackUrl
string

Merchant link to which information about the transaction payment result will be sent. If not passed, the link set in AdminUI will be used

Responses

Request samples

Content type
application/json
{
  • "terminalId": "TRM0001223",
  • "orderId": "string",
  • "amount": 145.25,
  • "currency": "MDL",
  • "payDescription": "string",
  • "clientName": "string",
  • "clientPhone": "string",
  • "clientEmail": "string",
  • "callbackUrl": "string"
}

Response samples

Content type
application/json
{
  • "orderId": "string",
  • "paymentId": "472e651e-5a1e-424d-8098-23858bf03ad7"
}

Payment request information

Allows you to check the status of the payment request, as well as obtain information about the transaction in case of successful payment

Authorizations:
bearerAuth
path Parameters
paymentId
required
string

Unique payment request identifier on the mia pos side

Responses

Response samples

Content type
application/json
{
  • "terminalId": "string",
  • "orderId": "string",
  • "paymentId": "string",
  • "status": "SUCCESS",
  • "amount": 145.25,
  • "currency": "MDL",
  • "paymentType": "rtp",
  • "paymentDate": "2024-05-20T16:32:28",
  • "swiftMessageId": "string",
  • "swiftPayerBank": "string"
}

public-key

Retrieve RSA Public Key

Provides the RSA public key in Base64 format for verifying signatures. This endpoint is secured with an access token and is used by merchants for validation purposes.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "publicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr1f/yhw+UI//z3KdpnJz..."
}

merchant-pay-callback

Receiving payment results from MIA POS

Description of the request that will be sent to the merchant with the payment result from the MIA POS system (to callback url)

Request Body schema: application/json
required

Information about the result of payment for the order. Before processing the result, you need to check the signature from MIA POS

required
object (OrderPaymentResult)

Information about the result of payment for goods on the ecomm mia pos side

signature
required
string

Generated signature of the miaPos system based on the result of order payment

Responses

Request samples

Content type
application/json
{
  • "result": {
    },
  • "signature": "string"
}