Skip to main content
POST
/
api
/
subscription
/
create
Create a subscription payment
curl --request POST \
  --url https://api.suby.fi/api/subscription/create \
  --header 'Content-Type: application/json' \
  --header 'X-Suby-Api-Key: <api-key>' \
  --data '
{
  "productId": "pro_sub456",
  "customerEmail": "customer@example.com",
  "priceCents": "999",
  "currency": "USD",
  "externalRef": "sub_ref_001",
  "metadata": {},
  "successUrl": "<string>",
  "cancelUrl": "<string>"
}
'
{
  "success": true,
  "data": {
    "paymentId": "pay_sub789",
    "paymentUrl": "https://checkout.suby.fi/sub/pay_sub789",
    "metadata": {}
  }
}

Authorizations

X-Suby-Api-Key
string
header
required

API key authentication

Body

application/json
productId
string
required

ID of a subscription product

Example:

"pro_sub456"

customerEmail
string<email>
required
Example:

"customer@example.com"

priceCents
string

Price in cents as a string. Required when the product has isCustomPrice: true. Must NOT be provided for fixed-price products. This price is locked for all future renewals.

Example:

"999"

currency
enum<string>

Currency for the price. Required when priceCents is provided, ignored otherwise.

Available options:
USD,
EUR
externalRef
string
Maximum string length: 255
Example:

"sub_ref_001"

metadata
object
successUrl
string<uri>
cancelUrl
string<uri>

Response

Subscription payment created

success
boolean
Example:

true

data
object