Accept recurring payments

Charge your customer on a regular basis.

About recurring

Recurring payments lets you debit your customer’s account with a fixed amount on a regular basis for recurring services. You can also use recurring payments for single debit transactions.

The recurring services include:

  • Membership fees
  • Subscription to a regular or varying service
  • Registration within a shop to avoid re-entering of payment data
  • Trial period, which require an initial registration for a later service

Recurring payments is accepted in the following two ways:

  1. Accepting recurring payments without the customer being present during the transaction.
  2. Saving a customer’s payment method and corresponding details only for the Accept payments with a payment page.

To accept recurring payments for a subscription service:

  1. The Embedded Payment Page or Hosted Payment Page opens.
  2. The customer selects one of the payment methods supported.
  3. The customer enters the payment method and corresponding details.
  4. The customer selects Save for later use.
    The returning customer can use the saved and pre-filled payment method, without having to re-enter their payment details.

Supported payment methods

The following payment methods support recurring:

Accept recurring payments

To accept recurring payments, make a POST call to types/<paymentId>/recurring, with a private key and the following parameters in the request body:

Parameter Required Type Default Description Example
returnUrl Yes String / Needed for redirect payments and credit card payments if 3-D Secure is used. https://www.unzer.com
customerId No String / The ID of the customers resource to be used.
metadataId No String / The ID of the related metadata resource.
curl https://api.unzer.com/v1/types/<paymentId>/recurring
  -u s-priv-xxxxxxxxxx: \
  -d returnUrl=https://www.unzer.com
POST https://api.unzer.com/v1/types/<paymentId>/recurring

Body:
{
  "returnUrl" : "https://www.unzer.com"
}
{
    "isSuccess": false,
    "isPending": true,
    "isError": false,
    "redirectUrl": "https://dev-payment.unzer.com/v1/redirect/3ds/s-I98KIK9alGzO",
    "message": {
        "code": "COR.000.200.000",
        "customer": "Transaction pending"
    },
    "returnUrl": "https://www.unzer.com",
    "date": "2019-03-07 11:42:47",
    "resources": {
        "customerId": "",
        "metadataId": ""
    },
    "processing": {
        "uniqueId": "31HA07BC8110C3EE06224EB9C3FC44C2",
        "shortId": "4158.8536.7528"
    }
}
Property Type Description
isSuccess Boolean Set to true if the transaction was successful.
isPending Boolean Set to true if the transaction is pending
(e.g. if a redirect to an external system is required).
isError Boolean Set to true if an error occurs.
redirectUrl String The URL to which the customer gets redirected after the payment.
message String An error message describing the error in more detail.
code String A unique ID of the message.

For details, go to Error code structure.
customer String Message displayed to the customer.
returnUrl String The URL to redirect the customer to after the payment is completed.
date String Date and time of the transaction.
resources Object The details linked to the payment.
customerId String The ID of the customers resource.
metadataId String The ID of the related metadata resource.
processing Object The process details of the related payment.
uniqueId String The ID of the transaction process.
shortId String The short ID of the transaction process.

Registering a Credit Card

To register a credit card as a recurring payment, implement the following flow:

  1. Unzer authorizes €1 to validate the credit card.
    If EUR currency is not available, the next configured currency is used.
  2. On the verification webpage, the customer enters a 3-D Secure password or a one-time token.
  3. If the 3-D Secure authentication is successful, the credit card is registered as a recurring payment.
  4. To charge the credit card with no user interaction, the 3ds flag is set to false for all future transactions.
  5. Unzer cancels the €1 authorization.

Registering a Paypal

To register Paypal as a recurring payment, implement the following flow:

  1. The customer goes to PayPal settings and enables a flag to allow recurring payments without customer interaction on their account.
  2. Create a new PayPal /types/<pay_pal_id>/recurring resource.
  3. Redirect the customer to the redirect URL.
  4. The customer logs in to their PayPal account and chooses their preferred payment option.
  5. After the customer enters their payment details, the PayPal types resource is successfully registered as recurring.
  6. Paypal can be used for direct charges without further customer interaction.

Registering Unzer Direct Debit

To use the recurring feature for Unzer Direct Debit, implement the following flow:

  1. Make a POST call to payments/charges.
  2. After a successful charge, Unzer Direct Debit resource is automatically set as recurring.

Registering with the Unique ID

Unzer’s old API required the unique ID (UUID) of an individual transaction to register a payment type as recurring. We still support this functionality. You can find the recurring information in Registrations page.