PilotFoxDocs
REST APIAPI referencePayment providers

Connect Stripe

PUT
/api/v1/sites/{siteId}/integrations/stripe

Checks the API key with the provider (400 when it is rejected or lacks a read permission), stores it encrypted, and queues the import of the last backfillDays days of payments (90 by default, 365 at most). When the key belongs to another account or mode than the payments already synced, those are deleted.

Requires site:update on the site (an API key, or a signed-in member's role). Share links: 401.

Authorization

headerx-api-key<token>

An organization API key (ak_…), with the permissions and the sites it was created with. For servers and scripts: no cookie and no Origin check. Also accepted as Authorization: Bearer ak_… (apiKeyBearer). A request carries one credential: a key sent with a share token or a live session cookie is 400 (details.reason: ambiguous_credentials).

Scope: site:update

Path Parameters

siteId*string

Request Body

application/json
  1. body
secretKey*string

A Stripe API key; never returned, stored encrypted

Match^(sk|rk)_(live|test)_[A-Za-z0-9_]{8,240}$
backfillDays?integer
Range1 <= value <= 365
Default90

Response Body

OK

application/json
  1. response
data*
Example Request
curl -X PUT 'https://pilotfox.app/api/v1/sites/string/integrations/stripe' \  -H 'Content-Type: application/json' \  -d '{  "secretKey": "string"}'
Example Response200
{  "data": {    "provider": "stripe",    "connected": true,    "keyHint": "string",    "livemode": true,    "accountName": "string",    "status": "ok",    "lastSyncAt": "string",    "lastError": "string",    "notice": "string",    "backfillDays": -9007199254740991  }}