# Create, list, and retrieve a payment plan

Create, list, and retrieve a payment plan

1. Create the payment plan on the terminal. Supply the merchant-assigned `paymentPlanId` in the body — the gateway does not generate it. This example models an `automatic` plan, so it includes a `recurringOrder`; for a `manual` plan, omit `recurringOrder`. `onUpdate`/`onDelete` define how attached subscriptions behave on later update/delete. Requires a unique `Idempotency-Key` header. Returns 201.
 [createPaymentPlan](/api/create-payment-plan)
2. OPTIONAL — returns a paginated list of the terminal's payment plans and extracts the first result's `paymentPlanId`. Plans are in the `data` array. Skip this step if you already hold the `paymentPlanId`.
 [listPaymentPlans](/api/list-payment-plans)
3. Retrieve the payment plan to confirm its current state. Surfaces the plan `name`, `frequency`, and `type`.
 [getPaymentPlan](/api/get-payment-plan)

## Workflow diagram

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