1. Create Payment

It's a method used to initiate payments with connected APM providers (QR-based). Through this method, payments are facilitated by displaying a QR code to users for scanning and completing transactions

Initiate Payment / QR-Based

POST {{Base Adres}}/api/paywall/apm/pay/qr/generate

Important: To use the APM Initiate Payment (QR-Based) service, you need to include the 'apikeypublic' and 'apiclientpublic' parameters in the 'Header' field.

PaymentAPI Address

The headers parameters that need to be sent to the service are as follows:

Parameter
Type
Compulsory
Description

apikeypublic

string

Yes

The Public Key obtained from the merchant panel.

apiclientpublic

string

Yes

The Public Client obtained from the merchant panel.

The parameters that need to be sent to the service in the BODY are as follows:

Parameter
Type
Compulsory
Description

ApmKey

int

Yes (Conditional)

The Key information of the APM provider.

Bkz: APM

ApmConnectionId

int

Yes (Conditional)

It is the Id (identifier) information obtained from the APM listing service connections. In scenarios where you dynamically generate your payment screen, you can initiate payments through the relevant connection using this parameter.

CurrencyId

int

Yes

The currency in which the payment is to be processed. Bkz: Currencies

MerchantUniqueCode

string

Yes

The unique identifier generated for the payment.

Amount

decimal

Yes

The payment amount

Description

string

Yes

Description of the payment. Depending on the provider, this description may be displayed on the payment screen.

Provider

object

No

This is used when there are specific information requirements from the provider. It is not currently active for QR-based payments and can be passed as null.

UserRedirectUrl

string

No

This is the address provided for redirection in wallet applications where scanning the QR code and successful payment may lead the user.

MerchantSuccessBackUrl

string

Yes

This is the address where the successful result of the payment will be reported via POST.

MerchantFailBackUrl

string

Yes

This is the address where the unsuccessful result of the payment will be reported via POST.

An example JSON file to be sent to the service is as follows:

{
    "ApmKey": "papara",
    "ApmConnectionId": null, // Eğer bağlantı kimlik Id'sini biliyorsanız
    "CurrencyId": 1,
    "MerchantUniqueCode": "55555454544333545435",
    "UserRedirectUrl": "https://merchantsite.com/?paymentId=13114141",
    "MerchantSuccessBackUrl": "https://merchantsite.com/callback/success",
    "MerchantFailBackUrl": "https://merchantsite.com/callback/fail",
    "Amount": 1,
    "Description": "PW test",
    "Payer": {
        "Fullname": "",
        "CardNumber": "",
        "CardId": "",
        "Phone": "",
        "Email": "",
        "UserIdentity": "",
        "ConsumerIdentity": "",
        "Birthday": null
    },
    "Products": [
        {
            "ProductId": "123",
            "ProductName": "Name",
            "ProductCategory": "Food",
            "ProductDescription": "Description of Product",
            "ProductAmount": 1
        }
    ]
}

The parameters returned from the service are as follows:

Parameter
Type
Description

ErrorCode

int

Error code. If the transaction is successful, it returns a value of '0'.

Result

bool

It returns a boolean value, where 'true' indicates a successful transaction.

Message

string

If the transaction fails, this message specifies the error, providing language support based on the 'locale' parameter.

Body

object

If the transaction fails, this object provides details about the error.

Body:FormatType

int

It indicates the format of the QR code.

Bkz: Formatlar

{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "ApmKey": "ProviderKey",
        "ApmConnectionId": 62,
        "ApmTransactionId": 11676,
        "UniqueCode": "273162b1-ffae-45c6-9e22-724ca27f826a",
        "MerchantUniqueCode": "55555454544333545435",
        "Amount": 1.0,
        "QrDetail": {
            "FormatType": 1,
            "Content": "%BASE64CONTENT%"
        }
    }
}

Last updated