maib MIA QR API
EN
EN
  • Overview
    • General Technical Specifications
    • MIA QR Types
  • Endpoints
    • Authentication
      • Obtain Authentication Token
    • Payment Initiation
      • Create QR Code (Static, Dynamic)
      • Create Hybrid QR Code
        • Create Extension for QR Code by ID
    • Payment Cancellation
      • Cancel Active QR (Static, Dynamic)
      • Cancel Active QR Extension (Hybrid)
    • Payment Refund
      • Refund Completed Payment
    • Information Retrieval (GET)
      • Display List of QR Codes with Filtering Options
      • Retrieve QR Details by ID
      • Retrieve List of Payments with Filtering Options
      • Retrieve Payment Details by ID
  • Payment Simulation (Sandbox)
  • Notifications on Callback URL
  • Errors
    • API Errors
    • HTTP Status Codes
  • Glossary
  • maib e-commerce API
Powered by GitBook
On this page
  1. Endpoints
  2. Authentication

Obtain Authentication Token

POST /v2/auth/token

This endpoint allows obtaining an Access Token required to authorize all subsequent requests to the QR MIA API.


Request parameters (body)

Parameter
Type
Required
Description

clientId

string (guid)

Yes

Client code provided by maib

clientSecret

string (guid)

Yes

The client’s secret key, provided by maib

Example request (body)

{
  "clientId": "749c564f-1a65-48e3-a4bf-b7932b6ae3db",
  "clientSecret": "0d922db8-9a2f-4c66-a60d-76a762c9bb04"
}

Response parameters

Field
Type
Description

result.accessToken

string

The access token to be used in the Authorization header

result.expiresIn

integer

The token's lifespan, in seconds

result.tokenType

string

The token type (Bearer)

ok

boolean

true if the request was successfully processed

errors

array

List of errors, if ok = false

Example response

{
  "result": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expiresIn": 300,
    "tokenType": "Bearer"
  },
  "ok": true
}

Using the Access Token After obtaining the token, it must be included in the header of every request to the QR MIA API in the form: Example usage (curl)

curl -X POST https://api.example.com/v2/mia/qr \
  -H "Authorization: Bearer {{access_token}}" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "Dynamic",
    "expiresAt": "2029-10-22T10:32:28+03:00",
    "amountType": "Fixed",
    "amount": 50.00,
    "currency": "MDL",
    "description": "Order description",
    "callbackUrl": "https://example.com/callback",
    "redirectUrl": "https://example.com/success"
  }'
PreviousAuthenticationNextPayment Initiation

Last updated 1 day ago