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

# Payment provider callbacks

> Understand Stripe Connect and Paystack completion callbacks and their acknowledgement semantics.

These are **provider-only callback endpoints**, not browser payment APIs. Do not manually manufacture success events or embed signing secrets in client code.

They are different from [outgoing Planpoint project webhooks](https://viewerdocs.planpoint.io/api-documentation/webhooks.md). Coordinate provider configuration with support; a Planpoint API token cannot replace a provider signature.

## Stripe Connect webhook

`POST /api/stripe/webhook-connect` — **Stripe signature**

Stripe sends the raw event body with a `Stripe-Signature` header. Planpoint verifies it against its configured Connect webhook signing secret.

Handled event types:

| Event | Effect |
| - | - |
| `account.updated` | Refreshes the linked merchant's onboarding/capability flags. |
| `payment_intent.succeeded` with `metadata.crfDeposit: "1"` | Records or updates the CRF deposit keyed by PaymentIntent ID. |
| `payment_intent.succeeded` with unit metadata | Validates the paid merchant/project/items and pricing, then processes inventory and reservation updates. |

Use the [unit checkout](https://viewerdocs.planpoint.io/api-documentation/payments/checkout.md#start-stripe-unit-checkout) or [CRF deposit](https://viewerdocs.planpoint.io/api-documentation/payments/crf.md#create-a-stripe-deposit-paymentintent) API to create the appropriate PaymentIntent and metadata. Do not replace or edit its signed price quote.

```json Response (200) theme={null}
{ "received": true }
```

An invalid/missing signature returns `400` with an `error` string. If a paid variant's related inventory cannot be updated, the endpoint returns `500` with `{ "received": true, "familyFailures": 1 }` (count varies), allowing provider retry.

> [!WARNING]
>
> `received: true` acknowledges delivery, not completion of every database update. Ignored events, rejected metadata, and some processing failures are acknowledged with `200`. If a provider shows a successful payment but a reservation/deposit is missing, check stored records and contact support rather than charging again.

This endpoint is for connected merchant payments. Planpoint subscription billing uses a different callback and is outside this reference.

## Paystack webhook

`POST /api/paystack/webhook` — **Paystack signature**

Provider setup URL: `https://app.planpoint.io/api/paystack/webhook`.

For a processed Planpoint charge, Paystack sends the original JSON body with `x-paystack-signature`, an HMAC-SHA512 signature verified using the configured merchant secret.

The handler processes `charge.success` events whose `data.reference` starts with `PP-`. It needs `data.metadata.userId` and a nonempty `data.metadata.planpoint` item array. Preserve project/group context, optional buyer ID, and `priceQuote` as described in [Paystack checkout metadata](https://viewerdocs.planpoint.io/api-documentation/payments/checkout.md#get-a-paystack-quote).

The callback uses provider amount, currency, payment timestamp, and customer details. It is the server-side completion path when the browser closes or its Portal session expires; do not remove it in favor of the browser callback.

```json Response (200, processed) theme={null}
{ "received": true, "processed": 1, "skipped": 0 }
```

Other response forms:

| Status | Body/meaning |
| - | - |
| `200` | `{ "received": true }` for other event types. |
| `200` | `{ "received": true, "skipped": true }` for a non-Planpoint reference. |
| `200` | `received` plus an `error` for missing metadata/configuration or some processing failures. |
| `200` | `received`, counters, `rejected: true`, and `reason` if payment processing rejects the selected items. |
| `400` | `{ "error": "Invalid request body" }` or `{ "error": "Invalid JSON" }`. |
| `401` | `{ "error": "Missing signature" }` or `{ "error": "Invalid signature" }` for a charge reaching signature verification. |
| `405` | Unsupported method. |
| `500` | `received`, counters, and `familyFailures` when related paid inventory could not be updated, allowing retry. |

Non-charge and non-Planpoint events are acknowledged without being processed. A `200` response, zero newly processed items, or skipped items is not by itself evidence of a new reservation.

## Completion checks

For an ambiguous payment outcome:

1. Identify the original provider transaction in the correct merchant account and test/live mode.
2. Check [recorded payments](https://viewerdocs.planpoint.io/api-documentation/payments/transactions.md#list-recorded-payments) and, for a signed-in buyer, [Portal reservations](https://viewerdocs.planpoint.io/api-documentation/portal/buyer-data.md#list-reservations).
3. Check inventory separately. A CRF deposit should not reserve it.
4. Escalate mismatches with the transaction reference and project ID. Do not create another charge, refund, or synthetic reservation merely to fix a display.

Callback retries and browser callbacks can overlap. Processing is not a single atomic transaction across the provider, inventory, and reservation records; do not assume exactly-once completion from an HTTP acknowledgement.


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