2. Payment Initiate (Id)

This is a method you can use to initiate payments with connected APM providers. This method requires an external connection Id. You can obtain the relevant Id information through the 'List' method.

Initiate Payment (Id)

POST {{Base Adres}}/api/paywall/apm/pay/byid

Important: To use the APM Payment Initiation service, you need to send the 'apikeypublic' and 'apiclientpublic' parameters in the 'Header' section.

PaymentAPI Address

The (HEADERS) parameters that need to be sent to the service are as follows:

ParameterTypeRequiredDescription

apikeypublic

string

Yes

The Public Key obtained from the merchant panel.

apiclientpublic

string

Yes

The Public Client obtained from the merchant panel.

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

ParameterTypeRequiredDescription

ApmId

int

Yes

The connection identity information of the APM provider. Returned during listing.

CurrencyId

int

Yes

The connection identity information of the APM provider. Returned during listing. See: Currencies

MerchantUniqueCode

string

Yes

The unique number generated for the payment.

MerchantSuccessBackUrl

string

Yes

The address where the successful result of the payment will be delivered. Post Body will receive the response.

MerchantFailBackUrl

string

Yes

The address to which the successful outcome of the payment will be communicated. It will receive the response in the Post Body.

Amount

decimal

Yes

The payment amount.

Description

string

Yes

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

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

{
    "ApmId": 1,
    "CurrencyId": 1,
    "MerchantUniqueCode": "TESTMERCHANTUNIQUECODE",
    "MerchantSuccessBackUrl": "https://webhook.site/38a6fa6f-3414-40db-b2a7-a6c38894b6a3",
    "MerchantFailBackUrl": "https://webhook.site/38a6fa6f-3414-40db-b2a7-a6c38894b6a3",
    "Amount": 1,
    "Description": "test"
}

The parameters returned from the service are as follows:

ParameterTypeDescription

ErrorCode

int

Error code. It returns '0' if the operation is successful.

Result

bool

It returns a 'true' or 'false' value. It returns 'true' if the operation is successful.

Message

string

If the operation is unsuccessful, this is the specified error message, providing language support based on the 'locale' parameter.

Body

object

If the operation fails, this is the error detail object.

{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "RedirectUrl": "https://dev-payment-agent.itspaywall.com/paywall/callbackapm?UniqueNumber=dd224827-8433-45f7-9454-97025e57fa9e",
        "Transaction": {
            "ApmTransactionId": 29,
            "UniqueCode": "dd224827-8433-45f7-9454-97025e57fa9e",
            "MerchantUniqueCode": "TESTMERCHANTUNIQUECODE",
            "Amount": 1.0
        }
    }
}

Last updated