Skip to main content

Create Payment Transaction

The merchant initiates a transaction which is a payment request sent to the user via mPay Server. The function returns the status of the transaction.

Resource Informations

NameValue
Requires authentication?Yes
Rate limited?No

Request

Request headers

NameValue
AuthorizationBearer token
Content-Typeapplication/json

HTTP request URL for SSMS

POST https://{tenantId}.{hostname}/digitanium/v3/mpower/payment/transaction

HTTP request URL for SHIFT

POST https://{hostname}/auth/realms/{tenantId}/mpower/v1/payment/transaction
note

API requests must be made over https. Calls made over plain http will fail.

Request body

Field NameTypeDescription
versionIntegerInner parameter for communication with SCP.
idempotencyIdStringA random ID to verify and avoid duplicate transactions from the Merchant.
userIdStringUnique ID of the user that is involved in the payment process.
merchantServiceUUIDStringUnique UUID of the Service which is also the clientid from mID. Provided by mID.
merchantCallbackStringCallback URL to notify the Merchant about the status of the transaction. This URL also contains the OrderID generated by the Merchant for correspondence.
transactionTimeoutIntegerLifecycle of the transaction in seconds.
merchantIdStringThe ID of the Merchant/Distributor.
amountIntegerThe total amount for payment. Total amount = shipping + tax + sum of all items in the order.
currencyStringThe currency code used for the transaction. E.g. USD, EUR, TRY
paymentContentStringBlock of information which contains details about the order.
referenceNumberStringMerchant can add his own reference ID here. The default value is 'PayInvoice'. This is an optional parameter.

Sample Request

{
"version": 1,
"idempotencyId": "<idempotencyId, optional, default- random UUID >",
"userId": "<userId>",
"merchantId": "<merchantId>",
"referenceNumber":"<referenceNumber,optional ,default -PayInvoice >",
"merchantServiceUUID": "<merchantServiceUUID>",
"merchantName": "<merchantName>",
"merchantCallback": "<Callback-URL>",
"transactionTimeout": 1,
"amount": 1300,
"currency": "TRY",
"paymentContent": [
[
{
"key": "Fatura Ödemesi",
"value": "12.03 TRY"
}
]
]
}

Response

Field NameTypeDescription
transactionIdStringUnique ID corresponding to the transaction.
transactionStatusStringStatus of the transaction.
transactionMessageStringBriefing on the transaction status.

Sample Response

{
"transactionId": "string",
"transactionStatus": "string",
"transactionMessage": "string"
}