📦Order and payment

After ordering a product or service on a website or at a point of sale, if the buyer selects payment via the DCM platform, the Merchant initiates a request using the POST /create_merchant’s_order method.

Endpoint

https://api-0s3og9.integrate.dcmapis.com/api/v1/merchants/order?jwt={{JWT}}'

Payload запиту

{
  "sub": "623e460b-9ffd-41df", - Merchant identifier (uid) 
  "exp": 1719493881, - Order expiration time
  "iat": 1707105971, -  Order creation time
  "amt": 1000, -  Order amount
  "cur": "UAH", -  Order currency
  "ref": "d4ee06f", -  Order number in the Merchant's accounting system
  "prp": "Payment for goods/services", -  Payment purpose
  "url": "https://www.city24.com", - Redirect URL for returning the buyer to the Merchant's website
  "fri": { - Information about the ultimate beneficiary of the funds (optional)
    "frn": "Kyivpark LLC", - Name
    "frc": "0987654321", - Tax number
    "fra": "UA55386780956567", -  Account number (IBAN)
    "frb": "300335", - Servicing bank's code
    "frm": "7791" -  Merchant category code
 }

Example Response:

{
"id":"3aa202bc-6b20-445d-89698274b11c66d0",
"link_deeplinks":"https://api.admin.smaug.armenotech.dev/api/v1/merchants/order?id=3aa202bc-6b20-445d-8969-8274b11c66d0&mobile=1",
"link_qr":"https://api.admin.smaug.armenotech.dev/api/v1/merchants/order?id=3aa202bc-6b20-445d-8969-8274b11c66d0&mobile=0"
}

Based on the received response, the DCM platform generates payment pages with the following payment options:

  • Scanning a QR code using the mobile app of a participating bank.

  • Scanning a QR code using the smartphone's camera.

  • Following a deep link, which automatically redirects to the payment interface.


QR Code Scanning with the Initiator Bank's Mobile App

This involves the Bank receiving the order_id parameter, which is embedded in the QR code data as a URL.

Example URL:

https://api.admin.smaug.armenotech.dev/api/v1/merchants/order?id=3aa202bc-6b20-445d-8969-8274b11c66d0&mobile=1"

order_id is passed as a query parameter.

The Bank must use the received order_id in a GET /merchants/order/nbu/json request to retrieve detailed information about the order.

Endpoint:

https://api-bank1.develop.dcmapis.com/api/v1/merchants/order/nbu/json/a27147e8-94ba-4ff7-82d2-0afd20c07d37

Positive Response (example):

{
  "id": "3aa202bc-6b20", - Order ID 
  "exp": 1719493881, - Order expiration time
  "amt": 1000, - Order amount
  "cur": "UAH", - Order currency
  "ref": "d4ee06f", - Order ID in the Merchant's system
  "prp": "Payment for goods/services", - Payment purpose
  "uid": "623e460b-9ffd-41df", - Merchant identifier 
  "recn": "Merchant", - Merchant's name
  "recc": "44684355", - Merchant's tax identification number
  "acc": "UA553806343157729535", - Merchant's account number (IBAN)
  "mcc": 5231, - Merchant category code
  "logo_url": "https://public-files-city24.svg", - Link to the Merchant's logo (if available)
  "bic": "380634", - Receiver bank's code (servicing the Merchant)
  "fri": { - Information about the ultimate beneficiary of the funds
    "frn": "Kyivpark LLC", - Name
    "frc": "0987654321", - Tax number
    "fra": "UA55386780956567", -  Account (IBAN)
    "frb": "300335", -  Servicing bank's code
    "frm": "7791" - Merchant category code
  },
  "bpk": { - Receiver bank's public key information (needed for encoding payment notification data)
    "alg": "RS256",
    "e": "AQAB",
    "n": "iwdsLwz7LyT4i9MJVfH...",
    "kid": "9A21DD62-DA56-402D-....",
    "kty": "RSA",
    "use": "sig"
  }
}

Negative Response

{
    "error": "func GetMerchantsOrderNbuJSONHandler() failed. Error: failed to get order by ID: get order by guid err: order not found"
}

QR Code Scanning with the Smartphone Camera or using following a Deep Link

This involves automatically redirecting the Bank's customer to the DCM platform’s payment page in their mobile browser. This page displays a list of participating banks along with corresponding deep links for completing the payment.

The deep link contains a reference to the participating bank's mobile app and payment information about the order in JWT format.

The structure of the payment information in JWT fully mirrors the JSON data from the QR code.

Example Deeplink structure:

https://awesome-bank.com.ua/deeplinks/payment_create?order=$JWT

JWT format

eyJhbGciOiJSUzI1NiIsImtpZCI6IjljMzdlYjc5LWI2YmYtNDQzNC1hYzNhLTM1NTZjOGI0YjBmNyIsInR5cCI6IkpXVCJ9.eyJhY2MiOiJVQTI0MzA1Mjk5MDAwMDAyNjAwMzAwNjcxODE4MSIsImFtdCI6MTAwLCJiaWMiOiIzMDUyOTkiLCJicGsiOnsiYWxnIjoiUlMyNTYiLCJlI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