Skip to content
API DocsDocs

Create Recurring Subscription

Card Tokenization — Create Recurring Subscription

11 min readUpdated Mar 27, 2026

POST /api/v1/payments/card/recurring

Create a recurring subscription tied to a tokenized card. Performs the first charge immediately (unless skipFirstCharge: true). Returns a subscriptionId for subsequent management.

Guide: Recurring Payments — conceptual walkthrough, flow diagrams, and integration patterns.

#Headers

HeaderValue
Content-Typeapplication/json
AuthorizationBearer {token} — see Authentication

#Request Body Parameters

FieldTypeRequiredDescription
requestIdStringYesUnique identifier for the request. Used for idempotency — if you retry with the same requestId, the system will return the original response instead of processing a duplicate.
midStringYesMerchant account ID. Identifies which merchant account the transaction is associated with.
cardTokenStringYes
planObject — See SubscriptionPlanYes
billingDetailsObject — See BillingDetailsNo
orderObject — See OrderNo
deviceObject — See DeviceNo
callbackUrlStringYesServer-to-server webhook URL. Exirom sends a POST with the final transaction result to this URL. See Webhook Callbacks.
successRedirectUrlStringYesURL to redirect the customer after a successful payment or 3D Secure authentication.
failureRedirectUrlStringYesURL to redirect the customer after a failed payment or 3D Secure authentication.
skipFirstChargeBooleanNo
metadataMap<String, String>NoArbitrary key-value pairs for your own use (e.g. order reference, campaign ID). Returned unchanged in responses and callbacks.
FieldTypeRequiredDescription
amountStringYesTransaction amount as a decimal string in major currency units (e.g. "10.00" = ten dollars). Values with more than two decimal places are automatically rounded.
currencyStringYesThree-letter ISO 4217 currency code (e.g. USD, EUR, GBP).
frequencyString (DAILY, WEEKLY, MONTHLY, CUSTOM)Yes
intervalIntegerYes
startDateStringYes
endDateStringNo
FieldTypeRequiredDescription
externalUserIdStringNoYour internal customer identifier. Useful for linking transactions to user accounts in your system.
firstNameStringNoCustomer's first name. Required for 3DS2 frictionless flow.
lastNameStringNoCustomer's last name. Required for 3DS2 frictionless flow.
address1StringNoBilling street address (line 1). Required for 3DS2 frictionless flow.
cityStringNoBilling city. Required for 3DS2 frictionless flow.
stateStringNoBilling state or province.
countryStringNoBilling country as an ISO 3166-1 alpha-2 code (e.g. US, GB, DE).
postalCodeStringNoBilling ZIP or postal code.
phoneStringNoCustomer's phone number (including country code). Required for 3DS2 frictionless flow.
emailStringYesCustomer's email address.
dateOfBirthStringNoCustomer's date of birth in YYYY-MM-DD format. Required for 3DS2 frictionless flow.
FieldTypeRequiredDescription
dateStringNoOrder date in ISO 8601 format (e.g. 2025-07-17).
orderIdStringNoYour unique order identifier for reconciliation.
titleStringNoOrder title or description (e.g. "Monthly Subscription").
siteIdStringNoIdentifier for the site or platform where the order originated.
nameStringNoCustomer name associated with the order.
domainNameStringNoDomain where the order was placed (e.g. "shop.example.com").
FieldTypeRequiredDescription
deviceIdStringNoUnique identifier for the customer's device, if you generate one.
fingerprintDataStringNoDevice fingerprint hash for risk assessment and fraud prevention.
ipStringNoCustomer's IP address. Used for geolocation and risk scoring.
acceptStringNoBrowser's Accept header value. Required for 3D Secure.
acceptLanguageStringNoBrowser's Accept-Language header. Required for 3D Secure.
acceptHeaderStringNoAlternative Accept header field. Required for 3D Secure if accept is not provided.
userAgentStringNoBrowser's User-Agent string.
javaEnabledBooleanNoWhether Java is enabled in the browser. Required for 3D Secure.
javaScriptEnabledBooleanNoWhether JavaScript is enabled. Required for 3D Secure.
deviceLanguageStringNoDevice's language setting (e.g. en). Required for 3D Secure.
colorDepthStringNoScreen color depth (e.g. "24" for 24-bit). Required for 3D Secure.
screenHeightStringNoScreen height in pixels. Required for 3D Secure.
screenWidthStringNoScreen width in pixels. Required for 3D Secure.
deviceTimezoneStringNoDevice timezone offset or name (e.g. "America/New_York"). Required for 3D Secure.

#Response

FieldTypeDescription
subscriptionIdString
transactionIdStringUnique transaction identifier assigned by Exirom. Use this ID to query status, retrieve info, or reference the transaction in support requests.
transactionStatusString (NEW, PENDING, FAILED, REFUNDED, CUSTOMER_VERIFICATION, ...)Current status of the transaction. See Transaction Status Guide for the full lifecycle.
declineCodeIntegerNumeric code indicating the reason for a decline. Only present when the transaction is FAILED. See Decline Codes Reference.
challengeUrlStringURL to redirect the customer for 3D Secure authentication. Present when transactionStatus is CUSTOMER_VERIFICATION.
challengeUrlIframeStringEmbeddable 3D Secure challenge URL for iframe integration. Present when transactionStatus is CUSTOMER_VERIFICATION.
nextChargeDateString
{
  "requestId": "req_abc123",
  "mid": "merchant_123",
  "cardToken": "example_cardToken",
  "plan": {
    "amount": "100.00",
    "currency": "USD",
    "frequency": "DAILY",
    "interval": 12345,
    "startDate": "2025-07-17",
    "endDate": "2025-07-17"
  },
  "billingDetails": {
    "externalUserId": "example_externalUserId",
    "firstName": "John",
    "lastName": "Doe",
    "address1": "123 Main St",
    "city": "New York",
    "state": "NY",
    "country": "US",
    "postalCode": "10001",
    "phone": "+12125551234",
    "email": "test@example.com",
    "dateOfBirth": "2025-07-17"
  },
  "order": {
    "date": "2025-07-17",
    "orderId": "ord_789",
    "title": "Product Purchase",
    "siteId": "site_001",
    "name": "John Doe",
    "domainName": "shop.example.com"
  },
  "device": {
    "deviceId": "example_deviceId",
    "fingerprintData": "example_fingerprintData",
    "ip": "192.168.1.1",
    "accept": "text/html,application/json",
    "acceptLanguage": "en-US,en;q=0.9",
    "acceptHeader": "text/html,application/json",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
    "javaEnabled": true,
    "javaScriptEnabled": true,
    "deviceLanguage": "en",
    "colorDepth": "24",
    "screenHeight": "1080",
    "screenWidth": "1920",
    "deviceTimezone": "America/New_York"
  },
  "callbackUrl": "https://yourserver.com/callback",
  "successRedirectUrl": "https://yourserver.com/callback",
  "failureRedirectUrl": "https://yourserver.com/callback",
  "skipFirstCharge": true,
  "metadata": {
    "key1": "value1"
  }
}
{
  "subscriptionId": "192.168.1.1",
  "transactionId": "example_transactionId",
  "transactionStatus": "NEW",
  "declineCode": 12345,
  "challengeUrl": "https://yourserver.com/callback",
  "challengeUrlIframe": "https://yourserver.com/callback",
  "nextChargeDate": "2025-07-17"
}

Idempotency: The requestId field ensures idempotent processing. If you retry a request with the same requestId, the original response is returned without reprocessing.

#Error Responses

HTTP StatusDescription
400Bad Request — missing or invalid parameters. Check the response body for field-level details.
401Unauthorized — missing, expired, or invalid bearer token. Re-authenticate via POST /api/v1/auth.
404Not Found — the requested resource does not exist.
500Internal Server Error — an unexpected error occurred. Retry with exponential backoff.
curl -X POST https://sandbox.api.exirom.com/api/v1/payments/card/recurring \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
  "requestId": "req_abc123",
  "mid": "merchant_123",
  "cardToken": "example_cardToken",
  "plan": {
    "amount": "100.00",
    "currency": "USD",
    "frequency": "DAILY",
    "interval": 12345,
    "startDate": "2025-07-17",
    "endDate": "2025-07-17"
  },
  "billingDetails": {
    "externalUserId": "example_externalUserId",
    "firstName": "John",
    "lastName": "Doe",
    "address1": "123 Main St",
    "city": "New York",
    "state": "NY",
    "country": "US",
    "postalCode": "10001",
    "phone": "+12125551234",
    "email": "test@example.com",
    "dateOfBirth": "2025-07-17"
  },
  "order": {
    "date": "2025-07-17",
    "orderId": "ord_789",
    "title": "Product Purchase",
    "siteId": "site_001",
    "name": "John Doe",
    "domainName": "shop.example.com"
  },
  "device": {
    "deviceId": "example_deviceId",
    "fingerprintData": "example_fingerprintData",
    "ip": "192.168.1.1",
    "accept": "text/html,application/json",
    "acceptLanguage": "en-US,en;q=0.9",
    "acceptHeader": "text/html,application/json",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
    "javaEnabled": true,
    "javaScriptEnabled": true,
    "deviceLanguage": "en",
    "colorDepth": "24",
    "screenHeight": "1080",
    "screenWidth": "1920",
    "deviceTimezone": "America/New_York"
  },
  "callbackUrl": "https://yourserver.com/callback",
  "successRedirectUrl": "https://yourserver.com/callback",
  "failureRedirectUrl": "https://yourserver.com/callback",
  "skipFirstCharge": true,
  "metadata": {
    "key1": "value1"
  }
}'

#Try It

SandboxTry it
https://sandbox.api.exirom.com/api
Was this helpful?