Skip to main content

Quickstart

Get your first payment working in 5 minutes with this step-by-step guide.

Get your first payment working in 5 minutes.

Before You Start​

Checkout Modern is enabled on request

Checkout Modern — the OAuth2-based Paysera Checkout API used in this quickstart — is currently rolled out to merchants on request. Before you can create a project or generate API credentials, your merchant account needs to be activated for Checkout Modern.

New merchants

Mention your interest in Checkout Modern during onboarding, and our team will activate it as part of your account setup.

Existing merchants

Contact Paysera Support or reach out to your account manager to have Checkout Modern enabled on your account.

Using Checkout Classic?

If you are integrating against the legacy Project ID + Project Password API, see the Checkout Classic documentation instead — no activation request is required for that product.

Amount Format

All amounts use minor currency units (cents): "1000" = €10.00

Step 1: Get Your Credentials​

Obtain your credentials from the Paysera merchant dashboard:

  • Client ID: Your OAuth2 client identifier
  • Client Secret: Your OAuth2 client secret
  • Project ID: Your merchant project identifier

Step 2: Create a Payment​

1. Get an access token

curl -X POST https://api.paysera.com/auth/realms/Paysera/protocol/openid-connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=your-client-id" \
-d "client_secret=your-client-secret"

Response:

{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}

2. Create a payment order

curl -X POST https://api.paysera.com/merchant-order/integration/v1/orders \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"project_id": "your-project-id",
"redirect_urls": {
"success_url": "https://your-site.paysera.net/success",
"failure_url": "https://your-site.paysera.net/failure",
"callback_url": "https://your-site.paysera.net/webhook"
},
"purchase": {
"reference": "ORDER-001",
"amount": "1000",
"currency": "EUR"
}
}'

Response:

{
"id": "a6f2b8e3-5e5f-47d9-b13f-87ed2db2938a",
"projectId": "your-project-id",
"amount": 1000,
"currency": "EUR",
"status": "pending_payment",
"reference": "ORDER-001",
"createdAt": 1736433270,
"updatedAt": 1736433270
}

3. Create a payment link

curl -X POST https://api.paysera.com/checkout-payment-link/integration/v1/payment-links \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ORDER_ID_FROM_PREVIOUS_STEP",
"name": "Order #001",
"lifetime": 3600,
"experience": {
"language": "en"
},
"purchase": {
"amount": 1000
}
}'

Response:

{
"id": "c8d9e0f1-2a3b-4c5d-6e7f-8a9b0c1d2e3f",
"link": {
"url": "https://checkout.paysera.com/pay/c8d9e0f1-2a3b-4c5d-6e7f-8a9b0c1d2e3f"
},
"status": "active",
"amount": 1000,
"currency": "EUR",
"createdAt": 1736433270
}

4. Redirect customer

Use the link.url from the response to redirect the customer to the payment page.

Step 3: Handle the Callback​

When the payment completes, Paysera sends a POST request to your callback URL:

<?php

// Verify webhook signature
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_PAYSERA_SIGNATURE'] ?? '';
$secret = getenv('PAYSERA_CLIENT_SECRET');

$expectedSignature = hash_hmac('sha256', $payload, $secret);
if (!hash_equals($expectedSignature, $signature)) {
http_response_code(401);
exit('Invalid signature');
}

// Process the webhook
$data = json_decode($payload, true);
$status = $data['order']['status'] ?? null;
$reference = $data['order']['reference'] ?? null;

if ($status === 'paid') {
// Payment successful - update your order
fulfillOrder($reference);
}

http_response_code(200);
echo 'OK';

Order Statuses​

StatusDescription
pending_paymentOrder created, awaiting payment
paidOrder fully paid - fulfill the order
canceledOrder was canceled
closedOrder closed

See Payment Statuses Reference for complete documentation.

Next Steps​