Skip to main content

Manage Recurring Billing

Set up automated recurring payments for subscriptions using Paysera Recurring Billing API. Perfect for SaaS, memberships, and subscription-based services.

Integration Steps

1

Get Paysera Account

Register for a Paysera account to get started.

Register Account
→
2

Order Payment Service

Order "Online payment collection via e-banking and other systems" service.

Settings → Profile Settings → Service management
→
3

Create a Project

Navigate to "Project and Activities" → "My projects" and create a new project.

Get your project_id and project_password
→
4

Add Website to Project

Add your website domain to the project settings for security.

Project settings → General project information
→
5

Confirm Website Ownership

Verify your website ownership using the provided ownership code.

Contact tech_support@paysera.com if needed
→
6

Integrate Recurring Billing

Use your credentials to integrate the Recurring Billing API.

Set up subscription cycles and start billing

How It Works

Automatic Recurring Payments

Paysera automatically charges customers based on your billing cycle without manual intervention.

Simple Setup

Enable recurring payments with just a few parameters in your payment request.

Payment Notifications

Receive callback notifications for every successful recurring payment.

Integration Examples

API Endpoint

Production: https://www.paysera.com/pay/

Creating a Recurring Payment

<?php
require_once 'WebToPay.php';

// Set up recurring payment parameters
$request = WebToPay::buildRequest([
    'projectid'     => '123456',
    'sign_password' => 'your_project_password',
    'orderid'       => 'subscription_' . time(),
    'amount'        => 2999,  // 29.99 EUR in cents
    'currency'      => 'EUR',
    'accepturl'     => 'https://yourdomain.com/subscription/success',
    'cancelurl'     => 'https://yourdomain.com/subscription/cancel',
    'callbackurl'   => 'https://yourdomain.com/subscription/callback',
    'test'          => 0,
    'p_email'       => 'customer@example.com',

    // Recurring payment parameters
    'repeat'        => 1,              // Enable recurring payments
    'repeatrequest' => 1,              // Request permission for recurring
    'repeat_type'   => 'month',        // Billing cycle: day, week, month, year
    'repeat_count'  => 0,              // Number of payments (0 = unlimited)
]);

// Redirect to payment page
header("Location: https://www.paysera.com/pay/?data=" . urlencode($request));
?>

Handling Recurring Payment Callback

<?php
require_once 'WebToPay.php';

try {
    $response = WebToPay::validateAndParseData(
        $_GET,
        '123456',
        'your_project_password'
    );

    // Check payment status
    if ($response['status'] == 1) {
        $orderId = $response['orderid'];
        $amount = $response['amount'];
        $email = $response['p_email'];

        // Check if this is initial or recurring payment
        if (isset($response['repeat'])) {
            // This is a recurring payment charge
            $paymentNumber = $response['payment_number'] ?? 1;

            // Update subscription record
            updateSubscriptionPayment($orderId, $amount, $paymentNumber);

            // Log recurring charge
            logRecurringCharge($orderId, $amount, $paymentNumber);
        } else {
            // Initial subscription setup
            activateSubscription($orderId, $amount);
        }

        // Always respond with OK
        echo 'OK';
    }

} catch (Exception $e) {
    logError($e->getMessage());
    echo 'Error: ' . $e->getMessage();
}
?>

Common Use Cases

SaaS & Software

Automate monthly or annual billing for software services, tools, and platforms.

Digital Content

Recurring billing for premium content, news subscriptions, and media streaming.

Education & Training

Monthly payments for course access, online learning platforms, and coaching programs.

Additional Resources

Recurring Billing API

Complete API reference with all recurring payment parameters

View API Reference

Checkout Classic

Base payment API for one-time transactions

View API Docs

Accept Payments Online

Learn about one-time payment integration basics

View Guide

Contact Support

Get help from our technical support team

Contact Us