> ## 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.

# Post-purchase offers & social proof

> Configure a product's one-click post-purchase offer and its checkout social proof with your API key or the MCP server.

Both settings live on a product and need the **Growth** plan (or higher) to
turn on. Turning them off and reading them is never gated. A call that turns
one on below Growth answers `403` with `code: "FEATURE_LOCKED"`:

```json theme={"system"}
{
  "error": "FEATURE_LOCKED",
  "code": "FEATURE_LOCKED",
  "upgradeRequired": true,
  "message": "This feature is part of a higher plan. Please upgrade your plan to use it.",
  "details": { "feature": "socialProof", "requiredPlan": "tier2", "requiredPlanName": "Growth" }
}
```

## Post-purchase offer

| Method | Path | MCP tool |
| - | - | - |
| `GET` | `/post-purchase/products/{id}` | `get_post_purchase_offer` |
| `PUT` | `/post-purchase/products/{id}` | `update_post_purchase_offer` |

`{id}` is the product buyers purchase first. Fields you leave out of a `PUT`
keep their value.

```bash theme={"system"}
curl -X PUT https://api.pocketsflow.com/post-purchase/products/665f1c2a9b3e4a0012ab34cd \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "enabled": true, "productId": "665f1c2a9b3e4a0012ab34ce", "discountPercent": 20 }'
```

```json theme={"system"}
{
  "postPurchaseOffer": {
    "enabled": true,
    "productId": "665f1c2a9b3e4a0012ab34ce",
    "discountPercent": 20
  }
}
```

| Field | Type | Notes |
| - | - | - |
| `enabled` | boolean | Show the offer after checkout. Needs `productId`. |
| `productId` | string | Another fixed-price, one-time product of yours, same mode (live/test). |
| `discountPercent` | integer | 0-90. The price after it must be at least 1.00. |

A `400` carries a `code` saying what is wrong with the offered product:
`same_product`, `other_mode`, `pay_what_you_want`, `credits`,
`not_available`, `checkout_disabled` or `too_cheap`.

When a buyer accepts, you receive `order.completed` for the new order (like
any order) and [`order.post_purchase_accepted`](/api-webhooks/events) with
`parentOrder.id`, the order it followed.

## Social proof

| Method | Path | Auth | MCP tool |
| - | - | - | - |
| `GET` | `/social-proof/products/{id}/settings` | API key | `get_social_proof_settings` |
| `PUT` | `/social-proof/products/{id}/settings` | API key | `update_social_proof_settings` |
| `GET` | `/social-proof/products/{id}` | Public | `get_social_proof` |

```bash theme={"system"}
curl -X PUT https://api.pocketsflow.com/social-proof/products/665f1c2a9b3e4a0012ab34cd/settings \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "enabled": true, "countWindow": "7d", "threshold": 5 }'
```

| Field | Type | Notes |
| - | - | - |
| `enabled` | boolean | Show social proof at checkout. |
| `purchaseCount` | boolean | "N people bought this in the last 24 hours / 7 days". |
| `countWindow` | `"24h"` \| `"7d"` | The window the count covers. |
| `threshold` | integer | 1-1000, default 3. Below it, no count and no notice. |
| `recentPurchases` | boolean | "Someone in Lyon bought this · 2h ago". |
| `rating` | boolean | Average review rating. |

The public read returns aggregates only (cached about 60 seconds), the same
numbers the checkout shows:

```json theme={"system"}
{
  "enabled": true,
  "purchases": { "count": 14, "window": "24h" },
  "recent": { "place": "Lyon", "placeKind": "city", "minutesAgo": 120 },
  "rating": { "average": 4.8, "count": 15 }
}
```

Counts include live, non-refunded orders only. `recent.place` is a city when
the payment recorded one, otherwise a two-letter country code. `enabled` is
`false` (and every other field `null`) when the setting is off or your plan
no longer includes it.


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