MIA POS terminal API (0.1.4)

Download OpenAPI specification:

POS Terminal API Call Sequence

APIs for operating Pos terminals according to the MIA standard. This version adds support for working with Hybrid and Static QR codes. A separate API for working with dynamic QR codes is considered deprecated, but is still supported.

  1. POS Activation

    • Initialize Terminal Activation: Perform a request to POST /pos/api/v1/terminal-activation/init to initialize terminal activation. The response will include the operation result and an activation identifier.
    • Confirm Terminal Activation: Perform a request to POST /pos/api/v1/terminal-activation/confirm to confirm the POS terminal.
  2. Operator Authorization and Access Token Retrieval

    • Operator Login: Perform a request to POST /pos/api/v1/seller/login to authorize the operator and retrieve access tokens.
    • Refresh Tokens: Perform a request to POST /pos/api/v1/seller/refresh to obtain a new pair of tokens based on the refresh token.
  3. Operator Shift Management

    • Check Shift Status: Perform a request to GET /pos/api/v1/shift/check to check the status of the current shift.
    • Open Shift: Perform a request to POST /pos/api/v1/shift/open to open a new shift.
  4. Query version for working with Dynamic, Hybrid, Static QR codes

    • Receiving active QR codes: POS terminal allows you to work with only one active Static or Hybrid QR code at a time. If the terminal already has a generated active static QR code, it will not be possible to create another hybrud QR code. Using this request, you can get a list of active QR codes on the POS terminal GET /pos/api/v2/qr/active. There are no restrictions on the number of active dynamic QR codes.
    • Generate QR Code: Perform a request to POST /pos/api/v2/qr to create a QR code of the desired type in the specified type of amount.
      This request allows you to:
      Generate a dynamic QR with a fixed amount type: one-time QR code for payment. The user will have to pay the exact amount.
      Hybrid QR code with a fixed amount type: QR code that can be used to set multiple payments. The user must pay a fixed payment amount. After payment, you need to create a new payment request using QR.
      Hybrid QR code with a controlled amount: the user will be able to enter an amount from a specified range when paying.
      Static QR with a fixed amount: a QR code that can make several simultaneous payments. The user must pay a set amount.
      Static QR code with controlled amount: You can make several simultaneous payments using QR. The user can pay an amount from the specified range.
      Static QR code with free amount: The user can pay the merchant any amount.

    Extension model transmits information about the amount of payment charged. When generating a hybrid QR code or a static QR with a free amount, the extension object is not transmitted.

    • Creates a new QR code extension: Perform a request to /pos/api/v2/qr/{qrId}/extension to create a new payment request using a static or hybrid QR code. This request does not apply to dynamic QR.
    • Check QR Code extension status: Perform a request to GET /pos/api/v2/qr/extension/{extensionId}/check to check the status of a payment request using a QR code.
    • Cancel hybrid QR code extension: Perform a request to DELETE /pos/api/v2/qr/extension/{extensionId} to cancel all active hybrid QR code extensions. This request is prohibited for other types of QR codes.
    • Cancel QR Code: Perform a request to DELETE /pos/api/v2/qr/{qrId} to cancel the QR code.
  5. Close Shift

    • Close Shift: Perform a request to POST /pos/api/v1/shift/close to close the current shift.
  6. Retrieve Z-Report

    • Get Z-Report: Perform a request to GET /pos/api/v2/shift/{shiftId}/z-report to retrieve the Z-report for a specific shift.
  7. Operator Logout

    • Logout: Perform a request to POST /pos/api/v1/seller/logout to log the operator out of the system.

pos-activation

Init terminal binding

Initializing an operation to bind an operation to a device

header Parameters
X-DEVICE
required
string

Device model, e.g: iPhone 14. Browser name - for web

X-PLATFORM-TYPE
required
string
Enum: "ios" "android" "web" "external_system"

Indicates the device platform

X-PLATFORM-VERSION
string

Platform version: 4.4; 10.1.

X-INSTALLATION-ID
required
string <uuid>

Application unique identifier: 628f8a47-50a4-47e4-be12-af6c4dac9573. Generated with every installation

X-NATIVE-APP-VERSION
integer

Pos terminal container version

X-POS-APP-VERSION
required
integer

Pos terminal application version

X-CORRELATION-ID
string <uuid>

Unique request identifier

Request Body schema: application/json
required

Request to initiate the operation of binding a terminal to a device

terminalId
required
string

Terminal identifier by which the binding to the device is initialized

merchantIdno
required
string

Merchant IDNO who owns the terminal

Responses

Request samples

Content type
application/json
{
  • "terminalId": "string",
  • "merchantIdno": "string"
}

Response samples

Content type
application/json
{
  • "result": "success",
  • "terminalActivationId": "e559d17a-a29b-49c0-878b-af3de2495d39",
  • "maskedPhoneNumber": "string",
  • "waitTimeToResend": 0
}

Resend OTP terminal binding

Resends the OTP code as part of an attempt to bind the terminal to the device

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Request Body schema: application/json
required

OTP resend request body

terminalActivationId
required
string <uuid>

Unique terminal activation identifier (binding the terminal to the device)

Responses

Request samples

Content type
application/json
{
  • "terminalActivationId": "e559d17a-a29b-49c0-878b-af3de2495d39"
}

Response samples

Content type
application/json
{
  • "result": "success",
  • "leftAttempts": 0,
  • "waitTimeToResend": 0
}

Confirmation of terminal binding

Confirmation of terminal binding by entering the OTP code

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Request Body schema: application/json
required

OTP confirmation model for terminal-to-device binding operation

terminalActivationId
required
string <uuid>

Unique terminal activation identifier (binding the terminal to the device)

otpCode
required
string <int32>

OTP code to confirm the operation

Responses

Request samples

Content type
application/json
{
  • "terminalActivationId": "e559d17a-a29b-49c0-878b-af3de2495d39",
  • "otpCode": "string"
}

Response samples

Content type
application/json
{
  • "result": "success",
  • "leftAttempts": 0
}

Retrieve Terminal and Merchant Information

Gets details about a terminal and its associated merchant using the terminal activation ID.

path Parameters
posActivationId
required
string <uuid>

Unique pos terminal activation identifier

Responses

Response samples

Content type
application/json
{
  • "result": "success",
  • "terminalId": 0,
  • "merchantIdno": "string",
  • "merchantName": "string",
  • "storeAddress": "string"
}

seller-auth

Authorization of the seller on the terminal

Performing seller authorization to gain access to the activated terminal

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Request Body schema: application/json
required

Seller authorization data

terminalActivationId
required
string <uuid>

Unique identifier of the activated terminal

username
required
string

Seller username to log in

password
required
string

Seller password

Responses

Request samples

Content type
application/json
{
  • "terminalActivationId": "e559d17a-a29b-49c0-878b-af3de2495d39",
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "result": "success",
  • "authTokens": {
    }
}

Logout from account

Request to exit the operator account

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Request Body schema: application/json
required

Operator logout data

refreshToken
required
string

Responses

Request samples

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

Updating the access token

Updating a pair of tokens based on a refresh token

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Request Body schema: application/json
required

Data for refreshing access tokens

refreshToken
required
string
terminalActivationId
required
string <uuid>

Unique identifier of the activated terminal

Responses

Request samples

Content type
application/json
{
  • "refreshToken": "string",
  • "terminalActivationId": "e559d17a-a29b-49c0-878b-af3de2495d39"
}

Response samples

Content type
application/json
{
  • "result": "success",
  • "authTokens": {
    }
}

shift

Check shift status

Checking operator shift status

Authorizations:
bearerAuth
header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "state": "opened",
  • "shiftId": "string"
}

Open shift

Opening a shift for terminal work

Authorizations:
bearerAuth
header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "result": "success",
  • "username": "string",
  • "shiftId": "string"
}

Closing a shift

Closing an operator work shift

Authorizations:
bearerAuth
header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "result": "success",
  • "username": "string",
  • "shiftId": "string"
}

Z-report by shift

Generates a z-report for a closed shift

Authorizations:
bearerAuth
path Parameters
shiftId
required
string

Unique identifier of the closed shift for which you need to obtain a z-report

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

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

Generate Z-report for a closed shift

Generates a Z-report for a closed shift. A Z-report contains a summary of transactions within a shift. It supports multiple output formats (e.g., PDF, JSON, PNG, TXT) and allows generating either a full report (with all transactions) or a short summary.

Authorizations:
bearerAuth
path Parameters
shiftId
required
string

Unique identifier of the closed shift for which you need to obtain a z-report

query Parameters
format
string (ReportFormat)
Enum: "pdf" "png" "txt" "json"

Format of the report. Supported formats: PDF, JSON, PNG, TXT. (default is PDF)

isFullReport
boolean

Flag to include a full list of transactions in the Z-report (default is false).

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "reportJson": {
    },
  • "result": "success",
  • "reportBinary": "string",
  • "reportText": [
    ]
}

Generate X-report for a opened shift

Generates a X-report for a opened shift. A X-report contains a summary of transactions within a shift. It supports multiple output formats (e.g., PDF, JSON, PNG, TXT) and allows generating either a full report (with all transactions) or a short summary.

Authorizations:
bearerAuth
path Parameters
shiftId
required
string

Unique identifier of the opened shift for which you need to obtain a X-report

query Parameters
format
string (ReportFormat)
Enum: "pdf" "png" "txt" "json"

Format of the report. Supported formats: PDF, JSON, PNG, TXT.

isFullReport
boolean

Flag to include a full list of transactions in the X-report (default is false).

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "reportJson": {
    },
  • "result": "success",
  • "reportBinary": "string",
  • "reportText": [
    ]
}

Generate receipt for a specific transaction

Generates a receipt for a specific transaction. A receipt contains the essential details of a transaction, such as the transaction amount, payment method, and date. The endpoint supports multiple output formats (e.g., PDF, JSON, PNG, TXT) to accommodate various use cases, such as printing a receipt or integrating it into external systems.

Authorizations:
bearerAuth
path Parameters
txId
required
string

Unique identifier of the transaction for which details need to be obtained

query Parameters
format
string (ReportFormat)
Enum: "pdf" "png" "txt" "json"

Format of the report. Supported formats: PDF, JSON, PNG, TXT.

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "reportJson": {
    },
  • "result": "success",
  • "reportBinary": "string",
  • "reportText": [
    ]
}

transactions

List of transactions

Returns a portion of transactions completed within the shift. From the most current to the oldest

Authorizations:
bearerAuth
query Parameters
shiftId
required
string

Unique shift identifier for which transaction requests are made

txId
integer <int64>

ID of the transaction from which earlier transactions are requested. If not transmitted, the most current data is returned

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "result": "success",
  • "isEnded": true,
  • "txList": [
    ]
}

Returns information about transaction details

Returns information about transaction details based on the passed identifier

Authorizations:
bearerAuth
path Parameters
txId
required
string

Unique identifier of the transaction for which details need to be obtained

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "result": "success",
  • "txInfo": {
    }
}

Create a return transaction

Initiates a return transaction for a completed transaction.

Authorizations:
bearerAuth
Request Body schema: application/json
required

Request body for initiating a transaction return.

txId
required
integer <int64>

Unique identifier of the transaction to be returned.

amount
number <double>

Amount to be refunded; applicable only if not a full refund.

fullRefund
required
boolean

Indicates whether the return is a full refund (true) or a partial refund (false).

ccy
string

Currency code for the transaction (e.g., MDL, EUR).

reasonCode
required
string

Code representing the reason for the return.

reasonMessage
string

Detailed message explaining the reason for the return.

Responses

Request samples

Content type
application/json
{
  • "txId": 0,
  • "amount": 0.1,
  • "fullRefund": true,
  • "ccy": "string",
  • "reasonCode": "string",
  • "reasonMessage": "string"
}

Response samples

Content type
application/json
{
  • "result": "success",
  • "requestId": 0
}

Get Return Reason list.

Retrieve a list of return reasons.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "reasonList": [
    ]
}

Get return request status.

Get transaction return request status.

Authorizations:
bearerAuth
path Parameters
requestId
required
integer <int64>

Responses

Response samples

Content type
application/json
{
  • "status": "processing",
  • "txReturnId": 0
}

dynamic-qr

Generate qr to pay Deprecated

Generates a dynamic qr for payment for the specified amount (deprecated). Used to create a dynamic QR with a fixed amount type. To create a new QR by type, see the request: /pos/api/v2/qr

Authorizations:
bearerAuth
Request Body schema: application/json
required

Payment information for which you need to generate a QR

amount
required
number <double>

Amount to be paid

Responses

Request samples

Content type
application/json
{
  • "amount": 0.1
}

Response samples

Content type
application/json
{
  • "result": "success",
  • "qrId": "46027dd2-ff11-4c24-8cf5-d54b1f7fd64c",
  • "qrExpireIn": 0,
  • "qrImage": "string"
}

Dynamic QR check state pay Deprecated

Checks the status using the generated QR code (deprecated). Checks status only using dynamic QR codes. See the request: /pos/api/v2/qr/extension/{extensionId}/check

Authorizations:
bearerAuth
path Parameters
qrId
required
string

Unique QR code identifier

Responses

Response samples

Content type
application/json
{
  • "state": "not_found",
  • "errorDescription": "string",
  • "txInfo": {
    }
}

Cancel qr-code Deprecated

Cancels the generated QR code for payment (deprecated). Old version of QR code cancellation, which works only on the dynamic type. To use the new cancellation functionality, you need to go to the request: DELETE /pos/api/v2/qr/{qrId}

Authorizations:
bearerAuth
path Parameters
qrId
required
string

Unique QR code identifier

Responses

Response samples

Content type
application/json
{
  • "result": "success"
}

qr-code-payee

Request information about active QR

Receives a list of active QR codes according to the specified type generated from this terminal. Currently, the terminal works with one active QR. If qrType is not transmitted, active QRs are returned without binding to type

Authorizations:
bearerAuth
query Parameters
type
string
Enum: "dynamic" "static" "hybrid"

Type of the QR code

isImageRequired
boolean
Default: false

Indicates whether an image should be included in the QR information

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "result": "success",
  • "codes": [
    ]
}

Creates a QR code of the specified type to allow you to request payments

Creates a new QR code with the ability to specify parameters for working with payments

Authorizations:
bearerAuth
header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Request Body schema: application/json
required

Information about the QR code configuration for the ability to submit a payment request

qrType
required
string (QrType)
Enum: "dynamic" "static" "hybrid"

Indicates the types of QR codes the terminal works with.

amountType
required
string (QrAmountType)
Enum: "fixed" "free" "controlled"

Indicates the type of amount that can be configured to receive payments

object

Not transmitted for free amount type and hybrid QR code

Responses

Request samples

Content type
application/json
{
  • "qrType": "dynamic",
  • "amountType": "fixed",
  • "extension": {
    }
}

Response samples

Content type
application/json
{
  • "result": "success",
  • "qrInfo": {
    }
}

Creates a new QR code extension

Creates a new payment request using the specified QR code. Only available for hybrid and static qr

Authorizations:
bearerAuth
path Parameters
qrId
required
string

Unique QR code identifier

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Request Body schema: application/json
required

Information about the new extension that needs to be created and linked to the QR code

amount
number <double>

Information about the fixed amount that the client must pay. Indicated if the QR was created with a fixed amount type

minAmount
number <double>

Indicates the minimum amount that the client can pay. Indicated for QR with a controlled amount type

maxAmount
number <double>

Indicates the maximum amount that the client can pay. Indicated for QR with a controlled amount type

Responses

Request samples

Content type
application/json
{
  • "amount": 0.1,
  • "minAmount": 0.1,
  • "maxAmount": 0.1
}

Response samples

Content type
application/json
{
  • "result": "success",
  • "extensionIfo": {
    }
}

Qr extension check state pay

Checks the status of the submitted payment request using the QR code

Authorizations:
bearerAuth
path Parameters
extensionId
required
string

Unique identifier of the QR code extension

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "state": "not_found",
  • "errorDescription": "string",
  • "lastTxInfo": {
    },
  • "totalPayments": 0
}

Cancels QR code extension

Cancels active QR code extension. Only available for QR hybrid type

Authorizations:
bearerAuth
path Parameters
extensionId
required
string

Unique identifier of the QR code extension

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "result": "success"
}

Get QR code details by id

Receives information about the QR code based on the transmitted id. It also returns data about the state of the QR code. Extension info will only be present in the response if it is in the active state.

Authorizations:
bearerAuth
path Parameters
qrId
required
string

Unique QR code identifier

query Parameters
isImageRequired
boolean
Default: false

Indicates whether an image should be included in the QR information

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "state": "not_found",
  • "qrInfo": {
    }
}

Cancel qr-code and extension

Cancels the QR code along with the active extension for receiving payments

Authorizations:
bearerAuth
path Parameters
qrId
required
string

Unique QR code identifier

header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "result": "success"
}

seller

Seller session information

Obtaining information about the seller session

Authorizations:
bearerAuth
header Parameters
X-CORRELATION-ID
string <uuid>

Unique request identifier

Responses

Response samples

Content type
application/json
{
  • "sellerInfo": {
    },
  • "terminalInfo": {
    },
  • "merchantInfo": {
    },
  • "placeInfo": {
    },
  • "bankInfo": {
    }
}

pos-settings

Get terminal settings

Retrieve current settings of a POS terminal

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "result": "success",
  • "qrSettings": {
    }
}

Set QR code settings

Set new QR code settings for a POS terminal.

Authorizations:
bearerAuth
Request Body schema: application/json
required
qrType
required
string (QrType)
Enum: "dynamic" "static" "hybrid"

Indicates the types of QR codes the terminal works with.

qrAmountType
required
string (QrAmountType)
Enum: "fixed" "free" "controlled"

Indicates the type of amount that can be configured to receive payments

qrTtl
integer >= 30
Default: 300

Time-to-live for QR codes in seconds

prohibitSettingsChange
boolean
Default: false

Flag to prohibit changes to settings in the MiaPos application

whenUpdated
string or null <date-time>

Indicates the last update timestamp for POS settings

Responses

Request samples

Content type
application/json
{
  • "qrType": "dynamic",
  • "qrAmountType": "fixed",
  • "qrTtl": 300,
  • "prohibitSettingsChange": false,
  • "whenUpdated": "2024-04-04T10:49:54"
}

Response samples

Content type
application/json
{
  • "result": "success"
}