Payments Academy
Listing large result sets PAYMENT OPERATIONS STARTED LIVE 01 Listing large result - payment API that lists transactions must ACTIVE 02 Reconciliation filtering - process that must account for every payment QUEUED 03 Opaque cursor - meaning the client must not try to interpret QUEUED 04 Sorting parameters - specified with a parameter such QUEUED 05 Sort key specification - API specification must state the sort key QUEUED 06 Date filter validation - same applies to date filters: a from date QUEUED A payment API that lists transactions must handle the case where the result is large: a corporate account may have 100 Step 1 of 6 Listing large result sets STARTED Listing large result payment API that lists transactions must ACTIVE Reconciliation filtering process that must account for every payment QUEUED Opaque cursor meaning the client must not try to interpret QUEUED Sorting parameters specified with a parameter such QUEUED Sort key specification API specification must state the sort key QUEUED Date filter validation same applies to date filters: a from date QUEUED A payment API that lists transactions must handle the case where the result is large: a corporate account may have 100
Reconciliation filtering PAYMENT OPERATIONS IN PROGRESS LIVE 01 Listing large result - payment API that lists transactions must DONE 02 Reconciliation filtering - process that must account for every payment ACTIVE 03 Opaque cursor - meaning the client must not try to interpret QUEUED 04 Sorting parameters - specified with a parameter such QUEUED 05 Sort key specification - API specification must state the sort key QUEUED 06 Date filter validation - same applies to date filters: a from date QUEUED For a reconciliation process that must account for every payment, a missed payment is a break. Step 2 of 6 Reconciliation filtering IN PROGRESS Listing large result payment API that lists transactions must DONE Reconciliation filtering process that must account for every payment ACTIVE Opaque cursor meaning the client must not try to interpret QUEUED Sorting parameters specified with a parameter such QUEUED Sort key specification API specification must state the sort key QUEUED Date filter validation same applies to date filters: a from date QUEUED For a reconciliation process that must account for every payment, a missed payment is a break.
Opaque cursor PAYMENT OPERATIONS IN PROGRESS LIVE 01 Listing large result - payment API that lists transactions must DONE 02 Reconciliation filtering - process that must account for every payment DONE 03 Opaque cursor - meaning the client must not try to interpret ACTIVE 04 Sorting parameters - specified with a parameter such QUEUED 05 Sort key specification - API specification must state the sort key QUEUED 06 Date filter validation - same applies to date filters: a from date QUEUED The cursor is opaque, meaning the client must not try to interpret it; it simply passes back the value the server returned. Step 3 of 6 Opaque cursor IN PROGRESS Listing large result payment API that lists transactions must DONE Reconciliation filtering process that must account for every payment DONE Opaque cursor meaning the client must not try to interpret ACTIVE Sorting parameters specified with a parameter such QUEUED Sort key specification API specification must state the sort key QUEUED Date filter validation same applies to date filters: a from date QUEUED The cursor is opaque, meaning the client must not try to interpret it; it simply passes back the value the server returned.
Sorting parameters PAYMENT OPERATIONS IN PROGRESS LIVE 01 Listing large result - payment API that lists transactions must DONE 02 Reconciliation filtering - process that must account for every payment DONE 03 Opaque cursor - meaning the client must not try to interpret DONE 04 Sorting parameters - specified with a parameter such ACTIVE 05 Sort key specification - API specification must state the sort key QUEUED 06 Date filter validation - same applies to date filters: a from date QUEUED Sorting is specified with a parameter such as sort=bookingDate:desc Step 4 of 6 Sorting parameters IN PROGRESS Listing large result payment API that lists transactions must DONE Reconciliation filtering process that must account for every payment DONE Opaque cursor meaning the client must not try to interpret DONE Sorting parameters specified with a parameter such ACTIVE Sort key specification API specification must state the sort key QUEUED Date filter validation same applies to date filters: a from date QUEUED Sorting is specified with a parameter such as sort=bookingDate:desc
Sort key specification PAYMENT OPERATIONS IN PROGRESS LIVE 01 Listing large result - payment API that lists transactions must DONE 02 Reconciliation filtering - process that must account for every payment DONE 03 Opaque cursor - meaning the client must not try to interpret DONE 04 Sorting parameters - specified with a parameter such DONE 05 Sort key specification - API specification must state the sort key ACTIVE 06 Date filter validation - same applies to date filters: a from date QUEUED The API specification must state the sort key, and the server must apply it consistently. Step 5 of 6 Sort key specification IN PROGRESS Listing large result payment API that lists transactions must DONE Reconciliation filtering process that must account for every payment DONE Opaque cursor meaning the client must not try to interpret DONE Sorting parameters specified with a parameter such DONE Sort key specification API specification must state the sort key ACTIVE Date filter validation same applies to date filters: a from date QUEUED The API specification must state the sort key, and the server must apply it consistently.
Date filter validation PAYMENT OPERATIONS COMPLETE LIVE 01 Listing large result - payment API that lists transactions must DONE 02 Reconciliation filtering - process that must account for every payment DONE 03 Opaque cursor - meaning the client must not try to interpret DONE 04 Sorting parameters - specified with a parameter such DONE 05 Sort key specification - API specification must state the sort key DONE 06 Date filter validation - same applies to date filters: a from date ACTIVE The same applies to date filters: a from date in the future, or a to date before the from date, must return a 400 with a clear message, not an empty list. Step 6 of 6 Date filter validation COMPLETE Listing large result payment API that lists transactions must DONE Reconciliation filtering process that must account for every payment DONE Opaque cursor meaning the client must not try to interpret DONE Sorting parameters specified with a parameter such DONE Sort key specification API specification must state the sort key DONE Date filter validation same applies to date filters: a from date ACTIVE The same applies to date filters: a from date in the future, or a to date before the from date, must return a 400 with a clear message, not an empty list.

Key points of this lesson, in order.

0:00 / 5:59 Step 1 of 6

Pagination, filtering and sorting: returning large result sets safely

API design standards and integration patterns, Lesson 2 of 7, Narration 5:59, D10 APIs and integration

ReconciliationISO 20022camt.053

What you will learn

Your objective. By the end of this lesson, you will be able to explain pagination, filtering and sorting: returning large result sets safely and apply it to a real banking scenario.

Why it matters. For a business analyst, the requirement is to define the filter parameters, the validation rules for each, the sort options, and the default sort, and to test each combination.

Chapter objective: How payment APIs are designed, versioned, secured and integrated

Key learning points

  • Listing large result sets
  • Reconciliation filtering
  • Opaque cursor
  • Sorting parameters
  • Sort key specification
  • Date filter validation

Key terms

Reconciliation: The process of comparing records from two sources, such as a bank statement and an internal ledger, to confirm they agree.

ISO 20022: An international standard for financial messaging that defines XML message formats for payments, securities and trade.

camt.053: An ISO 20022 bank to customer statement message that lists all entries posted to an account over a statement period, with opening and closing balances.

Payment flow diagram showing Pagination, filtering and sorting: returning large result sets safely.

Practise this lesson

Exercise

Handle the exception described in this lesson the way the lesson prescribes.

Use the exception type, the reason code and the recovery path in this lesson.

  1. What to do. State what happened, what the correct action is, what must not be done, and what the post-incident review should capture.

Correct result. The correct action is the one the lesson prescribes for this exception type, with the right reason code and the right message. The payment must not be resent without checking whether it already settled, because that creates a duplicate.

Why. An exception handled wrongly is worse than the exception itself. A duplicate payment is a loss, and an unlearned exception will happen again.

Check your understanding

Practice question

Which of the following best describes pagination, filtering and sorting: returning large result sets safely?

Takeaway and next step

What to remember

For a business analyst, the requirement is to define the filter parameters, the validation rules for each, the sort options, and the default sort, and to test each combination.

Follow a payment through every stage, from instruction to beneficiary credit, and note where it can stop.

Open the Payment Lifecycle Simulator →

Builds on "API versioning and lifecycle: how to change an API without breaking clients".

Transcript and full text

Show transcript

A payment API that lists transactions must handle the case where the result is large: a corporate account may have 100,000 payments in a year, and returning all of them in one response would be slow, expensive and likely to time out. Pagination splits the result into pages, and the client requests one page at a time. The two common approaches are offset pagination and cursor pagination, and the choice matters for payments because the underlying data changes while the client is paging through it. Source: API design guidance; bank API developer documentation. Offset pagination uses a page number and a page size: GET /payments?offset=0&limit=50 returns the first 50 payments, and offset=50&limit=50 returns the next 50. It is simple to understand and easy to implement, but it has a flaw: if a new payment arrives between the first and second request, every payment after it shifts by one position, so the client either sees the same payment twice or misses one entirely. For a reconciliation process that must account for every payment, a missed payment is a break. Offset pagination is acceptable for a user interface where a missed row is harmless, but it is not acceptable for a process that must be complete. A business analyst must know which use case each endpoint serves before choosing the pagination style. Cursor pagination uses an opaque pointer to the last item the client saw: GET /payments?cursor=abc123&limit=50 returns the next 50 payments after the item identified by abc123. Because the cursor points to a specific item rather than a position, a new payment arriving in between does not shift the results: the client continues from where it left off and sees every payment exactly once. For a business analyst, the requirement is to define this behaviour in the API specification, because the client builds against the specification and nothing else. The cursor is opaque, meaning the client must not try to interpret it; it simply passes back the value the server returned. The server typically encodes the sort key and the identifier of the last item in the cursor, so it can resume the query efficiently. Cursor pagination is the correct choice for payment listings, transaction history and any endpoint where completeness matters. The API specification must state that the cursor is opaque and that clients must not construct or modify it. Filtering and sorting let the client ask for a subset. A corporate treasury system that wants to reconcile Friday's supplier payments asks for GET /payments?from=2026-11-06&to=2026-11-06&status=ACCC, and receives only the payments that settled on that day. The API must validate the filter values: a from date after the to date returns a 400 error with a clear message, and an unknown status value returns a 400, not an empty list, so the client knows it asked for something wrong. Sorting is specified with a parameter such as sort=bookingDate:desc, and the API must state the default sort order when the client does not specify one, because a client that assumes chronological order and receives reverse chronological order will reconcile incorrectly. For a business analyst, the requirement is to define the filter parameters, the validation rules for each, the sort options, and the default sort, and to test each combination. Sorting by a field that is not unique can produce unstable results. If a client sorts payments by booking date and two payments have the same booking date, the order of those two payments is undefined, and it may change between requests. The client that pages through the results may then see the same payment twice or miss one. The fix is to sort by a unique key, or by a combination of fields that is unique, such as booking date and then payment identifier. The API specification must state the sort key, and the server must apply it consistently. A business analyst who writes a requirement for a payment listing endpoint must specify the sort key, the default sort, and the behaviour when two items have the same sort value, because these details are what make the endpoint reliable for reconciliation. The API documentation must state this rule plainly, because a client that has to guess will guess wrong. Filtering by status needs a defined code set and a defined behaviour for unknown values. If a client asks for payments with status SETTLED, and SETTLED is not a code the API uses, the API must return a 400 error with a code such as INVALID_STATUS, not an empty list. An empty list tells the client there are no settled payments, which is wrong; a 400 tells the client it asked for something the API does not understand, which is true. The same applies to date filters: a from date in the future, or a to date before the from date, must return a 400 with a clear message, not an empty list. For a business analyst, the requirement is to define the filter parameters, the code sets for each, the validation rules, and the error returned for each invalid combination. Further reading: API design guidance; ISO 20022 camt.052 and camt.053 account reporting message definitions. Last reviewed 7 November 2026.

A payment API that lists transactions must handle the case where the result is large: a corporate account may have 100,000 payments in a year, and returning all of them in one response would be slow, expensive and likely to time out. Pagination splits the result into pages, and the client requests one page at a time. The two common approaches are offset pagination and cursor pagination, and the choice matters for payments because the underlying data changes while the client is paging through it. Source: API design guidance; bank API developer documentation.

Offset pagination uses a page number and a page size: GET /payments?offset=0&limit=50 returns the first 50 payments, and offset=50&limit=50 returns the next 50. It is simple to understand and easy to implement, but it has a flaw: if a new payment arrives between the first and second request, every payment after it shifts by one position, so the client either sees the same payment twice or misses one entirely. For a reconciliation process that must account for every payment, a missed payment is a break. Offset pagination is acceptable for a user interface where a missed row is harmless, but it is not acceptable for a process that must be complete. A business analyst must know which use case each endpoint serves before choosing the pagination style.

Cursor pagination uses an opaque pointer to the last item the client saw: GET /payments?cursor=abc123&limit=50 returns the next 50 payments after the item identified by abc123. Because the cursor points to a specific item rather than a position, a new payment arriving in between does not shift the results: the client continues from where it left off and sees every payment exactly once. For a business analyst, the requirement is to define this behaviour in the API specification, because the client builds against the specification and nothing else.

The cursor is opaque, meaning the client must not try to interpret it; it simply passes back the value the server returned. The server typically encodes the sort key and the identifier of the last item in the cursor, so it can resume the query efficiently. Cursor pagination is the correct choice for payment listings, transaction history and any endpoint where completeness matters. The API specification must state that the cursor is opaque and that clients must not construct or modify it.

Filtering and sorting let the client ask for a subset. A corporate treasury system that wants to reconcile Friday's supplier payments asks for GET /payments?from=2026-11-06&to=2026-11-06&status=ACCC, and receives only the payments that settled on that day. The API must validate the filter values: a from date after the to date returns a 400 error with a clear message, and an unknown status value returns a 400, not an empty list, so the client knows it asked for something wrong.

Sorting is specified with a parameter such as sort=bookingDate:desc, and the API must state the default sort order when the client does not specify one, because a client that assumes chronological order and receives reverse chronological order will reconcile incorrectly. For a business analyst, the requirement is to define the filter parameters, the validation rules for each, the sort options, and the default sort, and to test each combination.

Sorting by a field that is not unique can produce unstable results. If a client sorts payments by booking date and two payments have the same booking date, the order of those two payments is undefined, and it may change between requests. The client that pages through the results may then see the same payment twice or miss one. The fix is to sort by a unique key, or by a combination of fields that is unique, such as booking date and then payment identifier.

The API specification must state the sort key, and the server must apply it consistently. A business analyst who writes a requirement for a payment listing endpoint must specify the sort key, the default sort, and the behaviour when two items have the same sort value, because these details are what make the endpoint reliable for reconciliation. The API documentation must state this rule plainly, because a client that has to guess will guess wrong.

Filtering by status needs a defined code set and a defined behaviour for unknown values. If a client asks for payments with status SETTLED, and SETTLED is not a code the API uses, the API must return a 400 error with a code such as INVALID_STATUS, not an empty list. An empty list tells the client there are no settled payments, which is wrong; a 400 tells the client it asked for something the API does not understand, which is true.

The same applies to date filters: a from date in the future, or a to date before the from date, must return a 400 with a clear message, not an empty list. For a business analyst, the requirement is to define the filter parameters, the code sets for each, the validation rules, and the error returned for each invalid combination. Further reading: API design guidance; ISO 20022 camt.052 and camt.053 account reporting message definitions. Last reviewed 7 November 2026.

Full lesson text (all scenes)

Completing a lesson updates your progress dashboard on the homepage.

Scene timestamps are estimated by allocating the narration text proportionally across the real audio length. The audio playback position is the source of truth: pause freezes the visual, seeking restores the correct scene, replay restarts the scene animation.