Recurring payments with Morefin Singular
Use Morefin Singular to start recurring payments or verify and store a card. The initial customer interaction is rendered on the merchant site by the <morefin-singular> component.
Transaction types
| Transaction type | When to use it | Amount handling |
|---|---|---|
RECURRING_DEPOSIT | Starts a recurring subscription with an initial customer-initiated transaction (CIT). | amount is required and must be greater than 0. |
CARD_VERIFICATION | Verifies and stores a customer card without charging the customer. | Do not include amount. Morefin processes the transaction as 0. |
RECURRING_DEPOSIT_MIT | Identifies future recurring charges generated by Morefin after the initial CIT is approved. | Do not create this transaction through Singular. Morefin processes it server-side. |
Recurring CIT flow
- Your backend creates a Singular checkout session with
transaction_typeset toRECURRING_DEPOSIT. - Include a positive
amountin minor units and arecurringobject containing the payment frequency. - Return the
session_idandsession_access_tokento the browser. - Mount
<morefin-singular>with the session ID and access token. - The customer completes the initial card payment in the Singular component.
- After approval, Morefin stores or updates the customer card token and creates the payment subscription.
- Morefin processes future subscription charges as merchant-initiated transactions (MIT) without another customer checkout.
Recurring request fields
| Field | Required | Description |
|---|---|---|
transaction_type | yes | Use RECURRING_DEPOSIT to create a recurring payment. |
amount | yes for RECURRING_DEPOSIT | Initial CIT amount in minor units. Must be greater than 0. |
currency | yes | ISO currency code, for example EUR. |
customer_id | recommended | Your external customer identifier, used to associate the payment and subscription with the customer. |
recurring.frequency | yes for RECURRING_DEPOSIT | Supported fixed values are daily, weekly, monthly, and annually. ISO-8601 durations such as P14D are also accepted. |
recurring.trial_period | no | Optional ISO-8601 duration before the first scheduled MIT, for example P7D. |
Create a recurring Singular session
Create the session from your backend. Never expose merchant authentication credentials in the browser.
curl --location 'BASE_URL/api/singular-checkout' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data-raw '{
"terminal_id": "{terminal_id}",
"reference": "{reference}",
"description": "Monthly subscription",
"currency": "EUR",
"amount": 1500,
"transaction_type": "RECURRING_DEPOSIT",
"recurring": {
"frequency": "monthly",
"trial_period": "P7D"
},
"success_url": "https://merchant.example.com/payment/success",
"cancel_url": "https://merchant.example.com/payment/cancel",
"error_url": "https://merchant.example.com/payment/error",
"customer_first_name": "John",
"customer_last_name": "Doe",
"customer_email": "john.doe@example.com",
"customer_phone_number": "+359888000000",
"customer_address": "1 Example Street",
"customer_city": "Sofia",
"customer_country": "BG",
"customer_postal_code": "1000",
"customer_id": "{customer_id}"
}'
The response contains the browser-scoped session credentials:
{
"session_id": "session-id",
"session_access_token": "eyJ...",
"session_access_token_expires_at": "2026-05-07T12:30:00Z"
}
Mount the component using the returned values:
<morefin-singular
session-id="session-id"
session-token="session-access-token"
locale="en"
environment="production"
></morefin-singular>
Singular displays the recurring frequency and optional trial period before the customer submits the initial payment.
Card verification flow
Use CARD_VERIFICATION to verify and store a card without an initial charge. Do not include amount.
curl --location 'BASE_URL/api/singular-checkout' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data-raw '{
"terminal_id": "{terminal_id}",
"reference": "{reference}",
"description": "Card verification",
"currency": "EUR",
"transaction_type": "CARD_VERIFICATION",
"success_url": "https://merchant.example.com/payment/success",
"cancel_url": "https://merchant.example.com/payment/cancel",
"error_url": "https://merchant.example.com/payment/error",
"customer_first_name": "John",
"customer_last_name": "Doe",
"customer_email": "john.doe@example.com",
"customer_phone_number": "+359888000000",
"customer_country": "BG",
"customer_id": "{customer_id}"
}'
Return the resulting session_id and session_access_token to the browser and mount Singular in the same way as for a recurring CIT.
Scheduling and retries
After a recurring CIT is approved, Morefin calculates the subscription schedule from the subscription start date, frequency, and optional trial_period. The payment subscription stores the next scheduled payment date. When that date is due, Morefin creates a recurring MIT attempt and advances the subscription schedule.
If a recurring MIT fails, retry behavior depends on the configured retry policy. When retry attempts are exhausted, or when no retry policy is configured, the subscription is paused and no further scheduled MITs are attempted until it is updated or resumed.
Recurring management APIs
- Payment subscriptions API — list subscriptions and update frequency, amount, start date, trial period, status, or active payment method.
- Card tokens API — retrieve the active card token, list available tokens for the same customer, or select another active token.