PayStar API Documentation
  1. FEATURES | EN
  • MERCHANT
    • PRODUCTS | EN
    • ПРОДУКТЫ | RU
    • FEATURES | EN
      • Deposits & Payouts
      • Issues (Tickets)
      • Secure data (One-time secret)
      • Summary Report
      • Payment Analytics
      • Payment Form Analytics
      • Unified audit log
      • Export reports
      • Black list
      • Routing & Cascading
      • Limits
      • Commissions
      • Team
      • My Account
      • PayStar in 100 Questions
    • ВОЗМОЖНОСТИ | RU
      • Депозиты и выплаты
      • Issues (Задачи)
      • Защищённые данные (One-time secret)
      • Сводный отчёт
      • Аналитика по платежам
      • Единый журнал событий
      • Аналитика платёжной формы
      • Экспорт отчётов
      • Черный список
      • Мавршрутизация и Каскады
      • Лимиты
      • Комиссии
      • Команда
      • Мой аккаунт
      • PayStar в 100 вопросах
    • API DOC | EN
      • Introduction
      • Glossary
      • Authorization key
      • Sandbox
      • Additional fields
      • Currencies
      • Bank names
      • Telecom operators
      • Callbacks
      • Error descriptions
      • Tech FAQ
      • Events
      • Payment history v2
        • Payment history - backward compatibility (legacy `X.Y.Z.W`)
      • Integratins
        • Stripe
        • Inwizo
        • 2Checkout
        • Adyen
        • AffiniPay
        • Alikassa
        • AlliancePay
        • Amazon Pay
        • AnyMoney
        • AstroPay
        • Aureavia
        • AurisMyChanger
        • Authorize.Net
        • Avatarix
      • Balance H2H
      • Deposit H2H - Card & P2P
      • Deposit H2H - Token
      • Deposit H2C - Card
      • Deposit status H2H - PayStar ID
      • Deposit status H2H - Merch ID
      • Payout H2H
      • Payout status H2H - PayStar ID
      • Payout status H2H - Merch ID
  • AGENT (REFERRAL)
  1. FEATURES | EN

Routing & Cascading

1) What Routing & Cascading gives you#

Routing & Cascading is a “traffic management engine” that allows you to:
Improve conversion: route payments to where approval/velocity/quality is higher.
Meet PSP requirements: limits by attempts, volume, and traffic quality.
Reduce risk: quotas for “untrusted” PSPs, turnover caps, piloting.
Increase resilience: fallback during degradation, processing/failed growth, quick channel disabling without rewriting the integration.
Segment traffic: FTD/STD, product storefronts, time, amounts, currency, issuer, etc.

2) Top use cases (ready recipes)#

Anti-spam: the PSP doesn’t want “spam” from unsuccessful attempts
The PSP accepts a user no more than 3 times per day
The PSP accepts a user for 5,000 USD per week
Traffic split: FTD (primary) vs STD (repeat)
Overlapping amount ranges across PSPs (50–500 and 100–700)
PSP degradation: processing/failed is growing
“Untrusted” PSP: limit by quota/turnover
Piloting a PSP on a segment

3) Where this is configured in the UI#

3.1 Merchants section#

image.png

3.2 Merchant card and pipelines list#

image.png

4) Condition builder: Add pipeline condition (field table + examples)#

Why it’s needed: you define a “selection rule” (condition) that determines which branch/route a payment will go to.
image.png

4.1 Condition fields (Attribute / Operation / Value)#

FieldWhat it isHow to fill itExample
AttributeWhat we check (amount, currency, time, issuer, etc.)Select from the list (see table below)Payment amount
OperationHow we compare>, >=, <, <=, ==, !=, ranges (a-b) / [a-b]<=
ValueThreshold/value for comparisonDepends on Attribute: number, currency code, range, time window500

4.2 Attribute: available parameters (with explanation and example)#

Attribute (UI)MeaningValue formatTypical business use caseExample condition
Payment amountCurrent payment amountNumber (major units) or rangeSplit PSPs by amount rangesPayment amount >= 100
Payment currencyPayment currencyISO code: USD, EUR, INR, etc.Different PSPs for different currenciesPayment currency == USD
Payment created at — timeTime-of-day windowTime/range (as in UI)“Day/night” provider, time-based SLAtime in range 10:00–17:00
Payment created at — day, timeDate+time windowTwo timestamps (as in UI)Promo period / pilot on specific dates2026-01-01 10:00 … 2026-01-30 17:00
Product codeProduct/storefront code sent by the merchantStringSplit traffic by productsProduct code == CASINO
Card issued bankCard issuer bankString/enum (as in UI)PSP-A performs better for a specific issuerCard issued bank == HDFC
Card issued payments processingCard scheme (processing)Enum/string (as in UI)Different PSPs for Visa/Mastercardprocessing == VISA
Card issued countryCard issuer countryCountry ISO code / enumGEO rules by issuer countrycountry == IN
Telecom operatorTelecom operator (carrier)String/enumRules for mobile scenarios/methodsoperator == Airtel
Payment detailsPayment history condition (aggregation)Separate form (see section 5)Anti-spam, attempt/volume limits, FTD/STDCountUnSuccess >= 3 for 1 hour
Note on time: Payment created at — time / day, time conditions are applied in the organization/team timezone.
image.png

4.3 Operation: available comparison operations (with examples)#

OperationMeaningExample (amount)When to use
>strictly greater thanamount > 500VIP/high-value branch
>=greater than or equalamount >= 100minimum threshold
<strictly less thanamount < 100micro-payments
<=less than or equalamount <= 500upper limit
==equalscurrency == USDexact match
!=not equalscurrency != EURexclusion
(a-b)between, excluding boundsamount (100-500)when bounds must be excluded
[a-b]between, including boundsamount [100-500]when bounds must be included

image.png#


4.4 Example of a “simple” rule (without history)#

Case: PSP-A works for amounts 50–500, PSP-B for 100–700.
Solution: create branches by Payment amount, and add a cascade in the overlap.
Example branches:
amount < 100 → PSP-A
100 <= amount <= 500 → PSP-A → PSP-B
amount > 500 → PSP-B
image.png

5) Payment details (history aggregation): detailed field table + examples#

Why it’s needed: “look back” and make a business decision based on payer history: anti-spam, attempt limits, volume limits, FTD/STD.
image.png

5.1 Payment details fields (each field in plain words)#

FieldMeaning (plain words)Format/valuesExample
Aggregation type (aggregationType)What exactly we calculate over historyCount* or Sum* (see table below)CountUnSuccess
Property (property)Which “key” to group history by (who we consider the same payer)payeerIdentifier, email, ip, cardToken, phoneNumber, …payeerIdentifier
Period (periodSeconds)How far back to lookSeconds or a human-readable choice in UI3600 (1 hour)
Direction type (directionType)Which operations to includeDeposit, Withdrawal, InheritDeposit
Entity type (entityType)Where to search for historyPipeline (current only) or Partner (all partner pipelines)Partner
Operation (operation)How to compare the metric to the threshold>, >=, <, <=, ==, !=, range>=
Value (value)Threshold valueFor Count* — number of attempts; for Sum* — amount3
Important:
the current payment is not included in the calculation;
if there is no history, the metric is 0.

5.2 Aggregation type: what each metric means#

aggregationTypeWhat it countsPlain explanationExample use case
CountTotalCount of all (success + failed + processing)“How many times they tried to pay”daily attempt cap
CountSuccessCount of successful“How many times it worked”FTD/STD, trust level
CountFailedCount of failed“How many explicit declines”anti-retry by declines
CountUnSuccessfailed + processing“How many did not reach success”anti-spam + catching “hangs”
SumTotalSum of all“Total turnover (any statuses)”rare scenario
SumSuccessSum of successful“How much actually went through”5,000 USD/week cap
SumFailedSum of failed“How much failed by amount”risk rules
SumUnSuccessSum of failed + processing“How much is stuck/unsuccessful by amount”degradation/risk

6) Webhooks: Callbacks#

Key points:
callbackUrl can be passed dynamically in the request (it has priority over the static one);
callbacks are not sent “retroactively” if URL/events were not configured in advance;
retries use Fibonacci backoff with a 7-minute step, up to ~27 hours.
you can configure notification types: status change (created, processing, success, failed) and payment amount change (relevant in some cases)
Callbeck tech doc
https://apidoc.paystar.uk/callbacks

image.png
:#

7) Integration: Keys, Required fields, cURL example#

7.1 Keys#

Key points:
opened in a modal by clicking the “lock” icon in the pipeline row;
you can regenerate — old keys will stop working;
you can build the token from keys yourself or use the ready-made token.
API Key tech doc
https://apidoc.paystar.uk/authorization
image.png

7.2 Required fields#

Key points:
the exact list of required fields depends on the pipeline settings — in practice, it is a superposition of fields requested by banks and payment gateways within this pipeline;
required fields are passed in the request body in the Additional Fields field.
Additional Fields tech doc
https://apidoc.paystar.uk/additionalfields
image.png

7.3 cURL example#

Key points:
to simplify integration, you can get an example of a ready-made request with required fields already assembled and an authorization token included.

image.png#

8) Troubleshooting#

8.1 The payment doesn’t go through due to rules/limits#

Typically, HTTP 423 is returned — this means that, under the current rules/constraints, the payment cannot be routed or is blocked by policy.

9) Best practices (quick)#

Always keep an alternative branch for fallback.
For anti-spam and degradations, CountUnSuccess is convenient.
For FTD/STD, use CountSuccess == 0.
For a pilot, segment by amount/time/FTD or use a separate Pilot pipeline.
For Sum* rules, avoid mixing currencies.
Previous
Black list
Next
Limits
Built with