palbaseDocs

Palbase Payments · API

POST/payments/channels

Connect payment channel

Directly connects or updates a Stripe (restricted key only) or iyzico channel with optional Masterpass vault credentials. Closed to environment tokens. Test and live money never meet: the environment goes live, for good, when its first live channel is connected (went_live_at). That connect is refused with 409 live_connect_blocked — its open lists what — while test money is left in the environment: a wallet's balance or debt (closed by reset_test_balances: true, or by POST /payments/wallets/test-balances/close first), or, either way, a payment not ended, a hold, a scheduled credit, or a credit still owed to a wallet. Once live, a test or sandbox channel is not connected (409 channel_mode_mismatch), reset_test_balances is 409 already_live, and a live channel connected again resets nothing.

Called by your server, with the project's secret key.

Request body

api_keystring · requiredStripe restricted key (rk_test_/rk_live_) or iyzico API key.
keystring · requiredStable lowercase channel key (e.g. stripe_global, iyzico_tr).
livemodeboolean · optionalTrue for live production credentials; false for sandbox/test.
masterpassobject · optionalOptional Masterpass card vault configuration attached to a channel.
provider"stripe" | "iyzico" · requiredPayment provider.
reset_test_balancesboolean · optionalClose the wallets' test balances as the environment's first live channel is connected: each wallet's balance (and a debt of test money) goes to a closed test account, with a closing line in the ledger. Refused (`409 already_live`) once the environment has gone live, and given only with a live channel.
secret_keystring · optionaliyzico secret key (required when provider is iyzico).
set_defaultboolean · optionalMake this channel the project default.
curl
curl -X POST "https://<your-ref>.palbase.studio/payments/channels" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"api_key":"string","key":"string","provider":"stripe"}'

Responses

201Channel connected

defaultStandard Palbase JSON error envelope (`error` and `error_description`).

Operation ConnectChannel of payments's contract.