Skip to content

Create Stripe Connection

POST/web/v1/workspaces/{workspaceId}/stripe/connectionsJWT

Creates a new Stripe connection for the current workspace. The connection stores the Stripe account credentials and webhook configuration needed for payment processing.

Authentication

Auth Chain: WEB Chain — requires Authorization: Bearer <jwt> Requires workspace:manage permission. These headers are injected by the system (frontend does nothing): X-PORTAL-ACCESS-CODE (Nginx), X-Request-Id (Gateway)

Request Parameters

NameTypeRequiredInDescription
workspaceIdstringYespathWorkspace business ID
connectionNamestringYesbodyDisplay name for the connection
connectionDescriptionstringNobodyOptional description of the connection
stripeAccountIdstringYesbodyStripe account ID (e.g. `acct_xxx`)
apiKeystringYesbodyStripe API secret key
webhookSecretstringYesbodyStripe webhook signing secret (e.g. `whsec_xxx`)
partnerEndpointstringYesbodyPartner callback endpoint URL
configJsonstringNobodyAdditional configuration as a JSON string

Success Response

Created201
{
  "version": "1.3.0",
  "timestamp": 1709337600000,
  "success": true,
  "code": "2000",
  "message": "SUCCESS",
  "data": {
    "bizId": "sc_abc123",
    "tenantBizId": "tn_xyz789",
    "connectionName": "Production Stripe",
    "connectionDescription": "Main production connection",
    "stripeAccountId": "acct_1234567890",
    "partnerEndpoint": "https://partner.example.com/webhook",
    "configJson": null,
    "status": 1,
    "statusName": "ACTIVE",
    "createdAt": "2026-03-21T00:00:00Z",
    "updatedAt": "2026-03-21T00:00:00Z"
  }
}

Error Responses

Unauthorized401
{
  "success": false,
  "code": "4010",
  "message": "Invalid or expired token"
}
Forbidden403
{
  "success": false,
  "code": "4030",
  "message": "Insufficient permissions"
}

Notes

  • The apiKey and webhookSecret fields are stored encrypted and are never returned in responses.
  • Requires the workspace:manage permission on the target workspace.
  • The connection is created in an active state by default.

Internal Documentation