# List payments, retrieve the target payment, then adjust it

List payments, retrieve the target payment, then adjust it

1. List payments filtered by terminal, status, and date. The response is paginated — payments are in the `data` array. This step extracts the first payment's `paymentId` for the follow-on steps.
 [listPayments](/api/list-payments)
2. Retrieve the full detail of the first payment from the list. Inspect the returned `supportedOperations` to confirm the payment can be adjusted before calling the adjust step.
 [getPayment](/api/get-payment)
3. Adjust the payment using the `paymentId` from the retrieve step. The body is an `adjustments` array of polymorphic objects — choose the right `type` discriminator:
  - `order`   — change the sale amount and/or tip breakdown (primary path).
  - `status`  — move the transaction to `ready` or `pending` via `toStatus`.
  - `customer`— update `shippingAddress` and/or `contactMethods`.
  - `signature` — attach `cardholderSignature` (cannot be adjusted once set).
Requires a unique `Idempotency-Key` header. Returns 200.
 [adjustPayment](/api/adjust-payment)

## Workflow diagram

```mermaid
flowchart TD
  step0["1. payment search · API"]
  step1["2. payment lookup · API"]
  step0 --> step1
  step2["3. adjustment request · API"]
  step1 --> step2
```
