vellTRDocs
API ReferenceSubscriptionsCreate Subscription

Create Subscription

POST/v1/subscriptionsOptional

Create a recurring subscription. cardToken is optional — it falls back to the customer's default saved card. Accepts an optional Idempotency-Key header.

Authentication

Signature Pattern

HMAC-SHA256(secretKey, "{timestamp}\nPOST\n/v1/subscriptions\n{sha256(body)}")
HeaderValueDescription
X-Api-Keypk_live_a1b2c3d4e5f6g7h8Merchant public API key
X-Signature{hmac_sha256_hex}Hex HMAC-SHA256 request signature
X-Timestamp2026-04-13T10:00:00ZISO 8601 UTC request time (±5 min)

Request Parameters

NameTypeRequiredDescription
storeIdstringRequiredStore the subscription belongs to
customerIdstringRequiredCustomer being billed
amountMinorintegerRequiredPer-cycle amount in kuruş
currencystringRequiredAlways "TRY"
intervalCountintegerRequiredNumber of interval units per cycle
intervalUnitstringRequiredday|week|month|year
cardTokenstringOptionalSaved card token (defaults to the customer default card)
trialEndAtstringOptionalISO 8601 — start trialing until this date
generateInvoicesbooleanOptionalGenerate an invoice each renewal
descriptionstringOptionalSubscription description

Request Example

JSONRequest Body
{
  "storeId": "sto_5a6b7c8d",
  "customerId": "cus_a1b2c3d4e5f6",
  "amountMinor": 50000,
  "currency": "TRY",
  "intervalCount": 1,
  "intervalUnit": "month"
}

Response Parameters

FieldTypeExample
idstring"sub_5e6f70819a2b"
merchantIdstring"mrc_8a1b2c3d4e5f"
storeIdstring"sto_5a6b7c8d"
customerIdstring"cus_a1b2c3d4e5f6"
publicHashstring"kQ7rS1tV5wY8zaB3xK9mN2"
statusstring"active"
amountMinorinteger50000
currencystring"TRY"
intervalCountinteger1
intervalUnitstring"month"
cycleNumberinteger0
nextChargeAtstring"2026-05-13T10:00:00Z"
cardLast4string"4321"
cardBrandstring"visa"
createdAtstring"2026-04-13T10:00:00Z"

Response Example

JSONResponse
{
  "id": "sub_5e6f70819a2b",
  "merchantId": "mrc_8a1b2c3d4e5f",
  "storeId": "sto_5a6b7c8d",
  "customerId": "cus_a1b2c3d4e5f6",
  "publicHash": "kQ7rS1tV5wY8zaB3xK9mN2",
  "status": "active",
  "amountMinor": 50000,
  "currency": "TRY",
  "intervalCount": 1,
  "intervalUnit": "month",
  "cycleNumber": 0,
  "nextChargeAt": "2026-05-13T10:00:00Z",
  "cardLast4": "4321",
  "cardBrand": "visa",
  "createdAt": "2026-04-13T10:00:00Z"
}

Status Codes

200Success
201Created
400Bad Request
401Unauthorized
404Not Found
429Rate Limited
Try itMock
POSThttps://api.pay.sandbox.kvell.group