1. Generate Repeatedly

Generate Recurring Payments

POST {{Base Adres}}/api/paywall/recurring

Important: To use the Recurring Payment Creation service, you need to send the 'apikeypublic' and 'apiclientpublic' parameters in the 'Header' field.

PaymentAPI Address

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 are as follows:

Parameter
Type
Compulsory
Description

Card:UniqueCode

string

Yes

The UniqueCode information of the stored card where payments will be received, returned from Paywall during saving and listing of registered cards.

SubscriptionType

int

Yes

Membership type. Currently, only one is supported. See: Recurring Payment

SubscriptionMerchantCode

string

Yes

The unique tracking number provided by your side for the recurring payment.

CurrencyId

int

Yes

Currency

Amount

decimal

Yes

The recurring payment amount. The amount to be deducted from the card each time.

CallbackUrl

string

No

The address where payment results will be POSTed. No callback will be sent if left empty See. Post Body

HasTrial

bool

Yes

Is there a trial period applied to the membership?

TrialDay

int

Yes

The number of days for the trial period applied to the membership. If the payment was created on 02/07 in a monthly period and there is a trial period of 10 days, the first payment will be charged on 12/08.

PaymentAtCreation

bool

Yes

If you send the parameter as TRUE, the first payment will be collected with the relevant information before the membership is created. Once the payment is successfully processed, the membership will be created with the corresponding card details. If FALSE is sent, the membership will be created along with the selected period, and a payment order will be generated. However, the first payment will not be collected when the membership is created. Note: If a trial day is provided, the frist

payment will be collected after today plus the trial day even if this parameter is

send as TRUE.

FirstPaymentDate

DateTime

No

You can determine the initial date of the payment on your side. If the parameter is sent as 2024-04-04, the payment will be collected on the specified date, 2024-04-04, and will continue with the period you have set thereafter.

Note: In case of your trial implementation, days are added on top of the initial payment date, and the payment is processed accordingly. If you specify 2024-04-04 and there is a trial period of 10 days, the first payment will be collected on 2024-04-14.

RecurringPeriodType

int

Yes

The type of period in which the payment will be repeated. See: Recurring Payment

RecurringPeriodCount

int

Yes (Conditional)

In case the membership type is 'Quantity-Based,' the desired quantity information to be deducted is entered.

FailAttempt

int

Yes

The number of retry attempts if the payment fails. Max: 5

FailAttemptPendingHour

int

Yes

The time zone that Paywall will wait between retry attempts for failed payments. Max: 24

Customer:SubscriptionCustomerPoolId

int

No

If a membership is to be created with a record from the Customer/User pool, it is the ID (identifier) information of the relevant record.

Customer:Name

string

Yes

The username/customer name associated with the payment in your system.

Customer:Lastname

string

Yes

The surname associated with the payment in your system.

Customer:Phone

string

Yes

The phone number associated with the user/customer in your payment system.

Customer:Email

string

Yes

The email address associated with the user/customer in your payment system.

Customer:Country

string

Yes

The country information associated with the user/customer in your payment system.

Customer:City

string

Yes

The city information associated with the user/customer in your payment system.

Customer:Address

string

Yes

The address information associated with the user/customer in your payment system.

Customer:IdentityNumber

string

Yes

The identification information associated with the user/customer in your payment system.

Items:SubscriptionItemPoolId

int

No

If a membership is to be created with a record from the Content Pool, it is the ID (identifier) information of the relevant record.

Items:Type

int

Yes

The type of sale that the payment concerns. See: Recurring Payment

Items:Name

string

Yes

The name of the sale that the payment concerns.

Items:Amount

decimal

Yes

The amount of the sale that the payment concerns. the items object is on array, and the entered items should be equal tı the total amount array'dir ve girilen item'lerin Amount

Sample to be sent for service JSON and example codes Sample to be sent for service

{
    "Card": {
        "UniqueCode": "aQbAoMhiAeYSfailjc2UzF7S1E/6QC=="
    },
    "SubscriptionType": 1,
    "SubscriptionMerchantCode": "12asaaaaasssaasaass2ada3",
    "CurrencyId": 1,
    "Amount": 110,
    "CallbackUrl": "https://webhook.site/8d70cb8e-fe1b-478b-8ee3-823870549ef2",
    "HasTrial": false,
    "TrialDay": 10,
    "FirstPaymentDate": "2023-09-26T05:00", // Null can be provided
    "RecurringPeriodType": 1,
    "RecurringPeriodCount": 0, // RecurringPeriodType
        // When parameter 2 is sent, the API...
        // It is controlled by the API. It takes a value between 0 and 365!
    "FailAttempt": 1,
    "FailAttemptPendingHour": 1,
    "Customer": {
        "SubscriptionCustomerPoolId": null, // Customer/User
            // If a selection has been made from the pool and...
            // If a membership is being created, the record in the pool...
            // ID (identity) information
            // -Creating with pool data
            // No need for the following information instantly-
        "Name": "Jogni",
        "Lastname": "Kivi",
        "Phone": "5554433212",
        "Email": "[email protected]",
        "Country": "Turkey",
        "City": "Istanbul",
        "Address": "Heaven",
        "IdentityNumber": "11111111110"
    },
    "Items": [
        {
            "SubscriptionItemPoolId": null, // Membership content
            // If a selection has been made from the pool and...
            // If a membership is to be created, the record in the pool
            // ID (identity) information
            // -Creating with pool data
            // No need for the following information instantly-
            "Type": 1,
            "Name": "Gold Package",
            "Amount": 110
        }
    ]
}

The parameters returned from the service are as follows:

Parameter
Type
Description

ErrorCode

int

Error code. Returns '0' if the operation is successful.

Result

bool

It returns a True or False value. If the operation is successful, it returns 'true'.

Message

string

If the operation fails, this is the specified error message.

Body

object

No details are returned.

{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": null
}

Last updated