> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pocketsflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment plans and exit offers

> Configure a product’s payment plan, exit discount and downsell with your API key, and read what a checkout offers.

Base URL `https://api.pocketsflow.com`. Authenticate with your API key
(`Authorization: Bearer pk_live_…` or `pk_test_…`). Turning a feature **on**
needs the Growth plan; turning it off never does.

## Read the settings

`GET /products/{id}/checkout-offers`

```json theme={"system"}
{
  "paymentPlan": { "enabled": true, "installments": 3, "surchargePercent": 0 },
  "exitOffer": { "enabled": true, "valueType": "percentage", "value": 10, "discountId": "6710b2c49e3f1a0012cd56ef" },
  "downsell": { "enabled": true, "productId": "665f1c2a9b3e4a0012ab34ce", "price": 19 }
}
```

## Payment plan

`PATCH /products/{id}/payment-plan` — partial: fields you leave out keep their value.

| Field | Type | Notes |
| - | - | - |
| `enabled` | boolean | Offer “Pay in N” on the checkout. Needs a fixed price. |
| `installments` | integer | 2 to 6. Default 3. Payments are 30 days apart. |
| `surchargePercent` | number | Optional fee on the whole price, 0 to 25 (two decimals). |

```bash theme={"system"}
curl -X PATCH https://api.pocketsflow.com/products/665f1c2a9b3e4a0012ab34cd/payment-plan \
  -H "Authorization: Bearer $POCKETSFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": true, "installments": 3 }'
```

Response: `{ "paymentPlan": { "enabled": true, "installments": 3, "surchargePercent": 0 } }`.

## Exit offer and downsell

`PATCH /products/{id}/exit-offer` — send `exitOffer`, `downsell` or both.

| Field | Type | Notes |
| - | - | - |
| `exitOffer.enabled` | boolean | Show the one-time exit discount. |
| `exitOffer.valueType` | `percentage` \| `fixed` | |
| `exitOffer.value` | number | Whole percent 1–90, or an amount in your currency. |
| `downsell.enabled` | boolean | Offer a cheaper product when a buyer removes an order bump. |
| `downsell.productId` | string | Another of your products, same mode. |
| `downsell.price` | number | Its price on this offer; `0` uses the product's own price. |

Turning the exit offer on creates a discount with its own code (returned as
`exitOffer.discountId`); it stays in step with the amount you set.

## Errors

| Status | When |
| - | - |
| `400` | Invalid settings, e.g. `Choose between 2 and 6 payments.` |
| `403` | `code: FEATURE_LOCKED` — turning it on needs the Growth plan (`details.requiredPlan`). |
| `404` | No product with this id in your account (current mode). |

## What a checkout offers (public)

`GET /checkout-offers/{productId}` — no API key. Returns what the product's
checkout offers right now, with the seller's plan applied. An offer is `null`
when it is off or the plan no longer includes it.

```json theme={"system"}
{
  "paymentPlan": { "installments": 3, "surchargePercent": 0, "intervalDays": 30 },
  "exitOffer": { "valueType": "percentage", "value": 10 },
  "downsell": { "productId": "665f1c2a9b3e4a0012ab34ce", "name": "Notion OS Lite", "thumbnail": "", "price": 19 }
}
```

## Orders

Every payment of a plan is an order with `installment: { "index": 2, "of": 3 }`.
See the [`installment.paid`](/api-webhooks/events#installment-paid) and
[`installment.failed`](/api-webhooks/events#installment-failed) webhooks.

## MCP

The MCP server exposes `get_checkout_offers`, `update_payment_plan` and
`update_exit_offer`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.