1. Create Session
Before starting to use Masterpass services through Paywall, you need to create a Masterpass session with the relevant user's information.
Create Session
POST
{{Base Address}}/api/paywall/masterpass/session
It will be sufficient to send a request to the address provided above. You can use the 'Base Address' for both the Test environment and the Production environment as you wish.
apikeyprivate
string
Yes
The Private Key obtained from the merchant panel.
apiclientprivate
string
Yes
The Private Client obtained from the merchant panel.
The parameters that need to be sent to the service are as follows:
ReferenceCode
string
Yes
The unique tracking number of the related session.
UserId
string
Yes
The unique identity number of the user in your system on the payment screen.
UserPhone
string
Yes
The verified phone number of the user on the payment screen.
Force3D
bool
No
If the relevant parameter is sent as true, all payment processes will proceed with 3D Secure.
PhoneVerifiedByMerchant
bool
No
If the relevant phone number has been verified in your system, this parameter should be sent as true.
This way, Masterpass will not perform the phone number verification again.
{
"ReferenceCode": "{{$guid}}",
"UserId": "72812393211", // Kullanıcının sisteminizdeki tekil kimlik bilgisi
"UserPhone": "905123456710", // Kullanıcının sisteminizdeki doğrulanmış telefon numarası
"Force3D": false, // Kullanıcı tüm ödeme akışında 3D'ye zorlansın mı?
"PhoneVerifiedByMerchant": true // Telefon doğrulaması yapıldı mı?
}
Response returned from the service:
Body
Body
JSON containing payment details (optional)
ErrorCode
int
Error code. Returns '0' if the transaction is successful.
Result
bool
Returns either true or false. If the transaction is successful, it returns true.
Message
string
If the transaction fails, this is the error message provided, with language support according to the locale parameter.
Response returned from the service (Body):
SessionId
Guid
This is the identifier of the relevant session. It is used for authorization throughout the entire process. This information must be stored on your side until the process is completed.
SessionExpiryDate
DateTime
The expiration date of the session. When it is automatically renewed, the response objects of other Masterpass services will include the new SessionId and new SessionExpiryDate information.
{
"ErrorCodeType": 1,
"ErrorMessage": null,
"ErrorCode": 0,
"Result": true,
"Message": "",
"Body": {
"SessionId": "9b27433e-f36b-1410-80e5-004205aa382d",
"SessionExpiryDate": "2025-07-27T11:24:57"
}
}
Last updated