Skip to content

Subscriptions/Recurring

Create recurring orders without the customer on site.

Overview

The customer completes the initial purchase in the checkout as usual. You initiate later purchases through the Admin API, without the customer taking part.

Supported payment methods:

  • Qliro Invoice
  • Credit card

Invoices are sent by email, or by mail if letter invoice is selected.

Card subscriptions use a unique token that Qliro creates with the first purchase. You can display and manage masked card details on the subscription pages of your site. To add more cards, use the new card registration form. This is a card form rendered in a Qliro-managed iframe.

You manage the subscription logic. This feature lets you initiate payments regularly without the customer present.

How-to

In the 'Create Order' call for the initial purchase, tag each subscription item with metadata tags under the item.

For cards, provide a merchantSavedCreditCardPushURL in the Create order call. Qliro sends the credit card token and card details to this URL.

{
  "MerchantReference": "MerchantUniqueReference",
  "MerchantApiKey": "MERCHANTKEY",
  "Currency": "SEK",
  "Country": "SE",
  "Language": "sv-se",
  "MerchantConfirmationUrl": "http://Merchant.com/confirmation/",
  "MerchantTermsUrl": "http://Merchant.com/terms/",
  "OrderItems": [
    {
      "MerchantReference": "XXX",
      "Description": "ZZZ",
      "Quantity": "4",
      "PricePerItemIncVat": "450",
      "PricePerItemExVat": "450",
      "Metadata": {
        "Subscription": {
          "Enabled": true
        }
      }
    }
  ]
}

Retrieving order information

After the customer completes the purchase, you receive a status notification on merchantOrderManagmentUrl. If the customer paid by card, Qliro also sends a card information notification to merchantSavedCreditCardPushURL. The notifications arrive asynchronously and refer to the same orderId. See Notifications.

Use the card details to:

  • Display the cards linked to the subscription and their expiry dates on a subscription management page.
  • Track the card expiry date and remind the customer to register a new card before it expires.

Card details in GetOrder Response

{
  "MerchantSavedCreditCard": {
    "Id": "3d2092a6-7baf-49e3-bd34-d0d0d85744b5",
    "BrandName": "VISA",
    "ExpiryYear": 24,
    "ExpiryMonth": 12,
    "Bin": 346596,
    "Last4Digits": 1234,
    "MaskedNumber": "346596XXXXXX1234"
  }
}

Initiate recurring order

When the next order on the subscription is due to ship, use MerchantPayment to initiate a new payment on behalf of the customer. You then process this order like other orders, for example with MarkItemsAsShipped and ReturnWithItems.

For the request and response parameters and the error codes, see the API Reference.

Add a new card to a subscription

To add cards to an existing subscription, use the CreateMerchantSavedCreditCard endpoint on the Merchant API. It returns an HTML snippet for your site. The snippet renders a card form that captures card details in line with PCI-DSS.

For the request and response parameters and the error codes, see the API Reference.

When you deploy the HTML snippet from the CreateMerchantSavedCreditCard response, it defines a frontend communication endpoint. This is the variable qccf in the global scope of the browser window.

Implementation example

window.qccfReady = function(q1) {
  qccf.onCreditCardCreated(creditCardCreatedListener);
}

When the customer completes the new card registration and the payment succeeds, Qliro redirects the customer to your MerchantConfirmationUrl.