Authorisation rate
Authorisation rate by day and payment method: of the payments that reached an authorisation decision, the share that were authorised.
- Grain
- day (first decision, report time zone) x merchant account x payment method x payment currency
- Built from
- 1Raw tables
- 1Staging
- 2Core
- 1Analytics
- Reads from Adyen
- payments_accounting_report
- Ships as
- Weld and dbt SQL, open source on GitHub
1-- core.adyen.authorisation_rate
2-- Authorisation rate by day and payment method: of the payments that reached an
3-- authorisation decision, the share that were authorised.
4--
5-- Grain: day (first decision, report time zone) x merchant account x payment
6-- method x payment currency.
7-- Depends on: core.adyen.payment_lifecycle
8--
9-- DEFINITION. A payment counts once, on the day of its first Authorised or Refused
10-- record. authorisation_rate = authorised / (authorised + refused), a ratio of
11-- counts. Re-aggregate the counts before dividing for weekly or monthly rates.
12--
13-- Each payment attempt has its own PSP reference, so a shopper who is refused and
14-- then succeeds counts as one refusal and one authorisation. Adyen's Customer Area
15-- can show a rate that de-duplicates retries or excludes some refusal reasons, so
16-- expect a small gap against it. Refused records only appear if your Payment
17-- accounting report includes them; if refused_count is always zero, check the
18-- report's configuration before reading the rate.
19
20SELECT
21 DATE(LEAST(
22 COALESCE(l.authorised_at_local, l.refused_at_local),
23 COALESCE(l.refused_at_local, l.authorised_at_local)
24 )) AS date,
25 l.merchant_account,
26 l.payment_method,
27 l.payment_currency,
28
29 COUNT(*) AS decided_count,
30 COUNTIF(l.is_authorised) AS authorised_count,
31 COUNTIF(NOT l.is_authorised AND l.is_refused) AS refused_count,
32 SUM(CASE WHEN l.is_authorised THEN l.authorised_amount ELSE 0 END) AS authorised_amount,
33 SAFE_DIVIDE(COUNTIF(l.is_authorised), COUNT(*)) AS authorisation_rate
34FROM {{core.adyen.payment_lifecycle}} l
35WHERE l.is_authorised OR l.is_refused
36GROUP BY 1, 2, 3, 4This model and the 3 it depends on. Deploy them together; refs like {{staging.…}} resolve to the matching folders in Weld, and the dbt view uses source() and ref().
How it counts. And where it stops.
DEFINITION. A payment counts once, on the day of its first Authorised or Refused record. authorisation_rate = authorised / (authorised + refused), a ratio of counts. Re-aggregate the counts before dividing for weekly or monthly rates. Each payment attempt has its own PSP reference, so a shopper who is refused and then succeeds counts as one refusal and one authorisation. Adyen's Customer Area can show a rate that de-duplicates retries or excludes some refusal reasons, so expect a small gap against it. Refused records only appear if your Payment accounting report includes them; if refused_count is always zero, check the report's configuration before reading the rate.
Raw tables it reads
- raw.adyen.payments_accounting_report
More Adyen models
Put Adyen in front
of your agents.
Connect Adyen, deploy the models, and ask questions in Claude, Cursor or ChatGPT. Free for 14 days, no credit card.