Get payment account
POST /api/get-payment-account — Public
Required userId is the project owner’s ID. Optional projectId supplies project context for provider mode selection.
Request
Response (200, illustrative configured account)
200 with { "disabled": true, "message": "Feature is not enabled" }. Invalid IDs return 400; an unknown owner returns 404.
Only public provider identifiers are returned. A localhost URL or copied project name does not guarantee test mode.
Start Stripe unit checkout
POST /api/stripe/create-checkout-session — Public
Despite its name, this endpoint creates a card PaymentIntent, not a Stripe Checkout Session.
Request
Response (200)
amount is the actual charge in major units; display it rather than trusting a previously loaded price. branding is the connected account’s primary color or null.
Use Stripe.js with the owner’s connected account and returned client secret to confirm the PaymentIntent. Completion is recorded through the Connect webhook, not by the creation response.
For uniform charges, each item’s price comes from the project’s global amount; otherwise it comes from that item or variant’s payable amount. Buy Now metadata can accompany eligible items, but its additional purchase-price amount is not added to the reservation fee.
Errors include 400 for invalid input/pricing or an unavailable Stripe connection, 403 for project/item access or disabled checkout, 404 for a missing owner, and 500 for a provider/server failure.
Check Stripe payment status
POST /api/stripe/session-status — Public
Send the nonempty PaymentIntent ID (not a Checkout Session ID) and owner ID.
Request
Response (200)
succeeded status is mapped to complete; other PaymentIntent statuses are returned unchanged. customer_email is the receipt email or null. This reads provider state, not reservation persistence.
Errors use error: 400 for invalid input, 404 for a missing owner, and 500 if retrieval fails.
Get a Paystack quote
POST /api/paystack/quote — Public
Request
Response (200)
amount is in major units. For a group cart, supply each item’s project; projects must belong to the same owner and use the same currency. The quote does not create a payment, reserve inventory, or acquire a hold.
Use a PP--prefixed reference when starting the Paystack payment. Preserve this metadata in the provider transaction:
Paystack metadata
groupId and each item’s project context. Do not forward hold tokens to Paystack. Convert the quoted amount to minor units for the Paystack client SDK (Math.round(amount * 100)).
Treat priceQuote as opaque; it is not a login token. It covers the owner, exact item IDs, total, and currency for 24 hours, checked at payment time when that timestamp is available. If it expires before payment, obtain a fresh quote. A quote is not an availability guarantee.
Errors include 400 for invalid input, missing project, invalid prices, or mixed currencies; 403 for wrong ownership/items or disabled payments; and 429 for rate limiting.
Process Paystack payment success
POST /api/paystack/payment-success — Portal buyer
Request
Response (200)
metadata.planpoint, not the submitted unit list, and checks merchant/project context and payment eligibility. Counters report processing results; skipped items or optional familyFailures require checking stored state. Do not treat success: true alone as proof that every cart item was reserved.
Invalid input or payment verification returns 400, missing/revoked Portal sessions 401, payment account/project mismatches or rejected processing 403, and an unknown owner 404. Errors can use either message or error; rejected processing returns { "success": false, "error": "Payment could not be authorized for the selected units." }.
The signed Paystack webhook is the separate completion path when a browser callback cannot finish, including checkout without a Portal session.
Check Paystack payment status
POST /api/paystack/session-status — Public
Required fields: reference and owner userId. Optional projectId supplies mode-selection context.
reference must be 1-100 characters, using only letters, numbers, ., _, =, and -, and must not contain ...
Request
Response (200)
amount here is in minor units, unlike the quote response. Provider fields may be absent if unavailable. This lookup does not create or link a reservation.
Errors use error: 400 for invalid input/provider verification failure, 404 for a missing owner, and 500 for missing provider configuration or retrieval failure.