# List, retrieve, then update a payment plan via JSON Patch.

List, retrieve, then update a payment plan via JSON Patch.

1. OPTIONAL — returns a paginated list of the terminal's payment plans and extracts the first result's `paymentPlanId`. Skip if you already hold the `paymentPlanId`.
 [listPaymentPlans](/api/list-payment-plans)
2. OPTIONAL — retrieve the payment plan to confirm its current state before patching. Surfaces the plan `name`, `frequency`, and `type`.
 [getPaymentPlan](/api/get-payment-plan)
3. Partially update the payment plan with an RFC 6902 JSON Patch document (the `patchDocument` input), NOT a plain plan object. Every property except `paymentPlanId` can be patched. Whether the change reaches existing subscriptions depends on the plan's `onUpdate` value. Requires a unique `Idempotency-Key` header. Returns 200.
 [updatePaymentPlan](/api/update-payment-plan)

## Workflow diagram

```mermaid
flowchart TD
  step0["1. plan search · API"]
  step1["2. plan lookup · API"]
  step0 --> step1
  step2["3. JSON Patch update · API"]
  step1 --> step2
```
