palbaseDocs

Palbase Payments · API

POST/payments/subscriptions

Create subscription

Creates a recurring subscription on the routed Stripe or iyzico channel and returns the initial NextAction.

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

Headers

Idempotency-Keystring · optionalUnique client-supplied idempotency key (1-255 chars) ensuring safe retries without duplicate charges, refunds, or ledger movements.

Request body

amountinteger (int64) · requiredWhat one of the quantity costs a period, in minor units (the whole period's when no `quantity` is given).
billing_modestring · optionalBilling mode: provider_native or platform_mit_marketplace.
cancel_urlstring · optionalAllowed cancel URL.
channelstring · optionalOptional channel key override.
currencystring · required3-letter ISO 4217 currency code.
customer_idstring · requiredCustomer UID.
descriptionstring · optionalSubscription description.
interval"day" | "week" | "month" | "year" · requiredBilling interval.
interval_countinteger (int32) · optionalNumber of intervals per cycle (default 1).
metadataobject · optionalArbitrary JSON metadata.
payment_method_idstring · optionalSaved payment method UUID for platform_mit_marketplace renewals.
product_namestring · requiredSubscription product name.
return_urlstring · requiredAllowed return URL.
split_templateobject[] · optionalMarketplace split template for MIT renewals.
trial_daysinteger (int32) · optionalOptional trial duration in days.
quantityinteger · optionalHow many of the unit the subscription is of (seats); 1 when not given. `amount` is what one costs: a period costs `amount` by `quantity`. Refused with `422 quantity_not_supported` on a channel whose capabilities do not say `subscription_quantity`.
curl
curl -X POST "https://<your-ref>.palbase.studio/payments/subscriptions" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"amount":0,"currency":"string","customer_id":"string","interval":"day","product_name":"string","return_url":"string"}'

Responses

201Subscription created

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

Operation CreateSubscription of payments's contract.